diff --git a/ormconfig.js b/ormconfig.js index 2cc4533b24..5ff4d06bbf 100644 --- a/ormconfig.js +++ b/ormconfig.js @@ -1,6 +1,6 @@ const devConfig = { type: 'sqlite', - database: 'config/db/db.sqlite3', + database: `${process.env.CONFIG_DIRECTORY || 'config'}/db/db.sqlite3`, synchronize: true, migrationsRun: false, logging: false, @@ -15,7 +15,7 @@ const devConfig = { const prodConfig = { type: 'sqlite', - database: 'config/db/db.sqlite3', + database: `${process.env.CONFIG_DIRECTORY || 'config'}/db/db.sqlite3`, synchronize: false, logging: false, entities: ['dist/entity/**/*.js'], diff --git a/server/lib/settings.ts b/server/lib/settings.ts index 8d1db87be8..01e73b897a 100644 --- a/server/lib/settings.ts +++ b/server/lib/settings.ts @@ -137,7 +137,11 @@ interface AllSettings { notifications: NotificationSettings; } -const SETTINGS_PATH = path.join(__dirname, '../../config/settings.json'); +const SETTINGS_PATH = path.join( + __dirname, + '../../', + `${process.env.CONFIG_DIRECTORY || '/config'}/settings.json` +); class Settings { private data: AllSettings; diff --git a/server/logger.ts b/server/logger.ts index 75e801512e..014bd336b8 100644 --- a/server/logger.ts +++ b/server/logger.ts @@ -42,7 +42,11 @@ const logger = winston.createLogger({ ), }), new winston.transports.DailyRotateFile({ - filename: path.join(__dirname, '../config/logs/overseerr-%DATE%.log'), + filename: path.join( + __dirname, + '../', + `${process.env.CONFIG_DIRECTORY || '/config'}/logs/overseerr-%DATE%.log` + ), datePattern: 'YYYY-MM-DD', zippedArchive: true, maxSize: '20m',