update env setup

This commit is contained in:
Matthias Hochmeister
2026-02-27 14:10:27 +01:00
parent 5e20cb9537
commit 44c7958980
6 changed files with 15 additions and 11 deletions

View File

@@ -1,12 +1,9 @@
import dotenv from 'dotenv';
import path from 'path';
// Load environment-specific .env file
const envFile = process.env.NODE_ENV === 'production'
? '.env.production'
: '.env.development';
dotenv.config({ path: path.resolve(__dirname, '../../', envFile) });
// Load from root .env (project-wide single source of truth).
// In Docker, env vars are already injected by docker-compose so this is a no-op.
dotenv.config({ path: path.resolve(__dirname, '../../../.env') });
interface EnvironmentConfig {
nodeEnv: string;