devops: add docker-compose.prod.yml overlay for production deployment #239

Open
opened 2026-04-15 11:26:34 +02:00 by marcel · 0 comments
Owner

Context

Now that the backend uses a proper multi-stage Docker build (PR #238), the next natural step is separating dev and production configuration via a Compose overlay pattern.

The current docker-compose.yml serves both dev and production. Environment-specific differences (Mailpit vs real SMTP, MinIO vs Hetzner S3, exposed debug ports, bind mounts) are currently mixed into a single file.

Goal

Add a docker-compose.prod.yml overlay that overrides production-specific settings:

# Development (unchanged)
docker compose up -d

# Production
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d

What the overlay should cover

  • Remove Mailpit service (use real SMTP in production)
  • Remove "${PORT_DB}:5432" port binding — database should not be reachable from outside the Docker network
  • Replace MinIO with Hetzner Object Storage endpoint (same S3 API, just different endpoint + credentials)
  • Remove any bind mounts that are dev-only
  • Set restart: always instead of restart: unless-stopped for critical services
  • Disable SpringDoc/Swagger UI (SPRING_PROFILES_ACTIVE: prod instead of dev,e2e)

References

  • PR #238 — multi-stage Docker build (prerequisite)
  • Tobias Wendt review on PR #238: "A docker-compose.prod.yml overlay would allow environment-specific overrides without duplicating the base file"
  • Markus Keller review on PR #238: same suggestion
## Context Now that the backend uses a proper multi-stage Docker build (PR #238), the next natural step is separating dev and production configuration via a Compose overlay pattern. The current `docker-compose.yml` serves both dev and production. Environment-specific differences (Mailpit vs real SMTP, MinIO vs Hetzner S3, exposed debug ports, bind mounts) are currently mixed into a single file. ## Goal Add a `docker-compose.prod.yml` overlay that overrides production-specific settings: ```bash # Development (unchanged) docker compose up -d # Production docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d ``` ## What the overlay should cover - Remove Mailpit service (use real SMTP in production) - Remove `"${PORT_DB}:5432"` port binding — database should not be reachable from outside the Docker network - Replace MinIO with Hetzner Object Storage endpoint (same S3 API, just different endpoint + credentials) - Remove any bind mounts that are dev-only - Set `restart: always` instead of `restart: unless-stopped` for critical services - Disable SpringDoc/Swagger UI (`SPRING_PROFILES_ACTIVE: prod` instead of `dev,e2e`) ## References - PR #238 — multi-stage Docker build (prerequisite) - Tobias Wendt review on PR #238: "A `docker-compose.prod.yml` overlay would allow environment-specific overrides without duplicating the base file" - Markus Keller review on PR #238: same suggestion
marcel added the devops label 2026-04-15 11:26:59 +02:00
Sign in to join this conversation.
No Label devops
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marcel/familienarchiv#239