Docker Compose
Standard compose file with environment variables:
services:
app:
image: my-app
build:
context: ../..
dockerfile: Dockerfile.app
ports:
- "${APP_PORT}:3000"
environment:
DB_PASSWORD: ${DB_PASSWORD}
ENV: ${ENV}
networks:
- app-network
networks:
app-network:All files in .deployment/docker/ are automatically processed with Jinja2 templating.
Environment Isolation (Automatic)
By default, ${ENV} and ${VERSION} are automatically added to:
- Image names
- Container names
This ensures complete isolation between different environments (production, staging, etc.).
Volumes and networks are automatically prefixed with the stack name by Docker Swarm (e.g., myapp-production_volname), so they donāt need additional environment suffixes.