Skip to content

fix: postgres-18.yml volume should mount at /var/lib/postgresql, not /var/lib/postgresql/data #77

Description

@ineedjet

Problem

apps/postgres-18.yml mounts the data volume at /var/lib/postgresql/data:

volumes:
  - ../apps-data/${APP_NAME}/postgres:/var/lib/postgresql/data

PostgreSQL 18+ images changed the default data directory structure — they now expect the mount at /var/lib/postgresql and create a versioned subdirectory (18/main) inside it. Mounting at /var/lib/postgresql/data causes postgres to fail on startup with:

Error: in 18+, these Docker images are configured to store database data in a
       format which is compatible with "pg_ctlcluster" (specifically, using
       major-version-specific directory names).
...
Counter to that, there appears to be PostgreSQL data in:
  /var/lib/postgresql/data (unused mount/volume)

See: docker-library/postgres#1259

Fix

volumes:
  - ../apps-data/${APP_NAME}/postgres:/var/lib/postgresql

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions