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
This commit is contained in:
William Valentin
2025-09-14 15:57:42 -07:00
parent d6851ad58e
commit b32cfcab2d

View File

@@ -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: