1.3 KiB
1.3 KiB
POST3-010: Production Docker Compose setup
Status: Todo Priority: P1 Blocked by: POST3-009
Description
Create a production-oriented Docker Compose setup that runs post3-server alongside PostgreSQL, with proper networking, health checks, and configuration.
Acceptance Criteria
Dockerfile(multi-stage) for post3-server:- Builder stage: rust image, compile release binary
- Runtime stage: debian-slim or alpine, copy binary + migrations
- Health check endpoint (add
GET /healthto router) - Non-root user
templates/docker-compose.production.yaml:postgresservice (PostgreSQL 18, persistent volume, health check)post3service (built image, depends_on postgres healthy, DATABASE_URL from env)- Named volumes for PostgreSQL data
- Internal network
- Port 9000 exposed for post3
templates/.env.example— sample env file for productionGET /healthendpoint on the server (returns 200 when DB is reachable)mise.tomltasks:prod:up— start production composeprod:down— stop production composeprod:build— build the Docker image
- README section on production deployment
Notes
The CI pipeline (POST3-009) will produce the container image. This ticket handles the compose orchestration for self-hosted deployment.