# docker-compose.yml — generated by `autumn release init --target docker-compose`
# Runs {{project_name}} + Postgres locally for integration testing or self-hosting.
services:
app:
build: .
ports:
- "3000:3000"
environment:
AUTUMN_PROFILE: prod
AUTUMN_DATABASE__PRIMARY_URL: postgres://autumn:autumn@db:5432/{{project_name}}_prod
AUTUMN_SECURITY__SIGNING_SECRET: "${AUTUMN_SECURITY__SIGNING_SECRET:?set it first}"
depends_on:
db:
condition: service_healthy
migrate:
condition: service_completed_successfully
restart: unless-stopped
migrate:
build: .
command: ["sh", "-lc", "autumn migrate"]
environment:
AUTUMN_PROFILE: prod
AUTUMN_DATABASE__PRIMARY_URL: postgres://autumn:autumn@db:5432/{{project_name}}_prod
depends_on:
db:
condition: service_healthy
restart: "no"
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: autumn
POSTGRES_PASSWORD: autumn
POSTGRES_DB: {{project_name}}_prod
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U autumn"]
interval: 5s
timeout: 5s
retries: 5
volumes:
postgres_data: