mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore(server): default postgres hostname to compose service name (#9118)
This commit is contained in:
parent
1e34b01986
commit
7ea539b753
4 changed files with 9 additions and 7 deletions
|
|
@ -6,7 +6,7 @@ const url = process.env.DB_URL;
|
|||
const urlOrParts = url
|
||||
? { url }
|
||||
: {
|
||||
host: process.env.DB_HOSTNAME || 'localhost',
|
||||
host: process.env.DB_HOSTNAME || 'database',
|
||||
port: Number.parseInt(process.env.DB_PORT || '5432'),
|
||||
username: process.env.DB_USERNAME || 'postgres',
|
||||
password: process.env.DB_PASSWORD || 'postgres',
|
||||
|
|
@ -26,8 +26,12 @@ export const databaseConfig: PostgresConnectionOptions = {
|
|||
...urlOrParts,
|
||||
};
|
||||
|
||||
// this export is used by TypeORM commands in package.json#scripts
|
||||
export const dataSource = new DataSource(databaseConfig);
|
||||
/**
|
||||
* @deprecated - DO NOT USE THIS
|
||||
*
|
||||
* this export is ONLY to be used for TypeORM commands in package.json#scripts
|
||||
*/
|
||||
export const dataSource = new DataSource({ ...databaseConfig, host: 'localhost' });
|
||||
|
||||
export const vectorExt =
|
||||
process.env.DB_VECTOR_EXTENSION === 'pgvector' ? DatabaseExtension.VECTOR : DatabaseExtension.VECTORS;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue