2022-02-03 17:06:44 +01:00
|
|
|
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
|
|
|
|
import dotenv from 'dotenv';
|
|
|
|
|
|
|
|
const result = dotenv.config();
|
|
|
|
|
|
|
|
if (result.error) {
|
|
|
|
console.log(result.error);
|
|
|
|
}
|
|
|
|
|
|
|
|
export const databaseConfig: TypeOrmModuleOptions = {
|
|
|
|
type: 'postgres',
|
2022-02-03 21:42:27 +01:00
|
|
|
host: 'immich_postgres',
|
2022-02-03 17:06:44 +01:00
|
|
|
port: 5432,
|
|
|
|
username: process.env.DB_USERNAME,
|
|
|
|
password: process.env.DB_PASSWORD,
|
2022-02-03 21:42:27 +01:00
|
|
|
database: process.env.DB_DATABASE_NAME,
|
2022-02-03 17:06:44 +01:00
|
|
|
entities: [__dirname + '/../**/*.entity.{js,ts}'],
|
|
|
|
synchronize: true,
|
|
|
|
// logging: true,
|
|
|
|
// logger: 'advanced-console',
|
|
|
|
// ssl: process.env.NODE_ENV == 'production',
|
|
|
|
// extra: {
|
|
|
|
// ssl: {
|
|
|
|
// rejectUnauthorized: false,
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
};
|