Add .env file support to docker-compose configurations

Added the `env_file` directive to both `docker-compose.yml` and `docker-compose.dev.yml` to load environment variables from a `.env` file. This ensures consistent environment variable management across different configurations.
This commit is contained in:
2025-02-28 09:20:42 +01:00
parent c1caea44e8
commit a924e0d5b2
2 changed files with 4 additions and 0 deletions

View File

@@ -28,6 +28,8 @@ services:
- backend_dev_modules:/app/.venv
ports:
- "8000:8000"
env_file:
- .env
environment:
- DATABASE_URL=${DATABASE_URL}
- SECRET_KEY=${SECRET_KEY}

View File

@@ -21,6 +21,8 @@ services:
context: ./backend
dockerfile: Dockerfile
target: production
env_file:
- .env
environment:
- DATABASE_URL=${DATABASE_URL}
- SECRET_KEY=${SECRET_KEY}