From b32cfcab2dd2e8b2c71a361ac46508e2f6a7dcf4 Mon Sep 17 00:00:00 2001 From: William Valentin Date: Sun, 14 Sep 2025 15:57:42 -0700 Subject: [PATCH] feat: add environment file support to Docker Compose - Add env_file configuration to all services for automatic .env loading - Enable consistent environment variable management across containers - Support development, production, CLI, and test service configurations - Maintain backward compatibility with existing environment overrides --- docker-compose.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index f77f896..80bab0a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,6 +19,8 @@ services: - /app/.venv # Exclude venv from bind mount - /app/backend/__pycache__ # Exclude cache - /app/.pytest_cache + env_file: + - .env environment: - DEBUG=true - LOG_LEVEL=debug @@ -43,6 +45,8 @@ services: container_name: unitforge-prod ports: - "8080:8000" + env_file: + - .env environment: - DEBUG=false - LOG_LEVEL=info @@ -68,6 +72,8 @@ services: - ./output:/output # Mount for output files - ./input:/input # Mount for input files working_dir: /app + env_file: + - .env networks: - unitforge-network profiles: @@ -84,6 +90,8 @@ services: - .:/app - /app/.venv - test-results:/app/test-results + env_file: + - .env environment: - PYTHONPATH=/app/backend command: @@ -114,6 +122,8 @@ services: volumes: - .:/app - /app/.venv + env_file: + - .env environment: - PYTHONPATH=/app/backend command: