# Production-style deployment: app + Postgres. Put a reverse proxy (nginx, caddy) # in front of 127.0.0.1:8080 that forwards example.com and *.example.com with # the original Host header. Configure via .env (see .env.example). services: app: build: . restart: unless-stopped env_file: .env environment: DATABASE_URL: postgres://blogspace:${POSTGRES_PASSWORD:-blogspace}@db:5432/blogspace?sslmode=disable ports: - "127.0.0.1:${APP_PORT:-8080}:8080" depends_on: db: condition: service_healthy db: image: postgres:17-alpine restart: unless-stopped environment: POSTGRES_USER: blogspace POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-blogspace} POSTGRES_DB: blogspace volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U blogspace"] interval: 5s timeout: 3s retries: 20 volumes: pgdata: