mirror of
https://github.com/immich-app/immich.git
synced 2025-01-09 05:16:47 +01:00
18 lines
689 B
TypeScript
18 lines
689 B
TypeScript
import { PostgresConnectionOptions } from 'typeorm/driver/postgres/PostgresConnectionOptions';
|
|
import { DataSource } from 'typeorm';
|
|
|
|
export const databaseConfig: PostgresConnectionOptions = {
|
|
type: 'postgres',
|
|
host: process.env.DB_HOSTNAME || 'immich_postgres',
|
|
port: parseInt(process.env.DB_PORT || '5432'),
|
|
username: process.env.DB_USERNAME,
|
|
password: process.env.DB_PASSWORD,
|
|
database: process.env.DB_DATABASE_NAME,
|
|
entities: [__dirname + '/../**/*.entity.{js,ts}'],
|
|
synchronize: false,
|
|
migrations: [__dirname + '/../migrations/*.{js,ts}'],
|
|
migrationsRun: true,
|
|
connectTimeoutMS: 10000, // 10 seconds
|
|
};
|
|
|
|
export const dataSource = new DataSource(databaseConfig);
|