Skip to content

Postgres container fails to start due to deprecated volume mount path in compose.yaml #492

@zong-miao

Description

@zong-miao

Description
I encountered an issue when trying to spin up the project using the default compose.yaml file. The postgres service fails to start because the volume mount path /var/lib/postgresql/data conflicts with the configuration of newer PostgreSQL Docker images (specifically regarding pg_ctlcluster compatibility).

Steps to Reproduce

  • Clone the repository.
  • Create .env from .env.example.
  • Run docker compose up.

Current Behavior
The splitpro-db container exits immediately with an error, and the splitpro app fails to start because the database is unhealthy.

Error Log:

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)
       ...
       The suggested container configuration for 18+ is to place a single mount
       at /var/lib/postgresql

Proposed Solution
Update compose.yaml to mount the volume to the parent directory /var/lib/postgresql instead of the data subdirectory. This allows the image to manage the version-specific paths internally.

Change in compose.yaml:

    volumes:
-     - database:/var/lib/postgresql/data
+     - database:/var/lib/postgresql

Environment
OS: Linux / Docker Desktop
Image: ossapps/postgres (latest)

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