Switch PostgreSQL and MinIO from bind mounts to named volumes for production #131

Open
opened 2026-03-28 08:40:20 +01:00 by marcel · 0 comments
Owner

Priority: medium — must be resolved before production deployment

docker-compose.yml uses bind mounts for persistent data (lines 12 and 33):

- ./data/postgres:/var/lib/postgresql/data
- ./data/minio:/data

Bind mounts are fine for local development but wrong for production. Host path permissions or an accidental docker compose down -v can result in data loss. Named volumes are Docker-managed and more resilient.

What to do

In the production compose file/overlay, replace bind mounts with named volumes:

services:
  db:
    volumes:
      - postgres_data:/var/lib/postgresql/data

  minio:
    volumes:
      - minio_data:/data

volumes:
  postgres_data:
  minio_data:

The development docker-compose.yml can keep the bind mounts for easy local data inspection.

**Priority: medium — must be resolved before production deployment** `docker-compose.yml` uses bind mounts for persistent data (lines 12 and 33): ```yaml - ./data/postgres:/var/lib/postgresql/data - ./data/minio:/data ``` Bind mounts are fine for local development but wrong for production. Host path permissions or an accidental `docker compose down -v` can result in data loss. Named volumes are Docker-managed and more resilient. ## What to do In the production compose file/overlay, replace bind mounts with named volumes: ```yaml services: db: volumes: - postgres_data:/var/lib/postgresql/data minio: volumes: - minio_data:/data volumes: postgres_data: minio_data: ``` The development `docker-compose.yml` can keep the bind mounts for easy local data inspection.
marcel added the phase-1: security label 2026-03-28 08:51:20 +01:00
marcel added the devops label 2026-03-28 10:47:25 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marcel/familienarchiv#131