Skip to content

Commit cbf9f42

Browse files
committed
fix(docker-compose): Remove the "data" directory from the volume mount
See the comment at [1]. This fixes the startup error saying: ``` 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). This better reflects how PostgreSQL itself works, and how upgrades are to be performed. See also docker-library/postgres#1259 Counter to that, there appears to be PostgreSQL data in: /var/lib/postgresql/data (unused mount/volume) This is usually the result of upgrading the Docker image without upgrading the underlying database using "pg_upgrade" (which requires both versions). The suggested container configuration for 18+ is to place a single mount at /var/lib/postgresql which will then place PostgreSQL data in a subdirectory, allowing usage of "pg_upgrade --link" without mount point boundary issues. ``` [1]: docker-library/postgres#1259 (comment) Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 647881a commit cbf9f42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
db:
77
image: postgres:18.0
88
volumes:
9-
- db-data:/var/lib/postgresql/data
9+
- db-data:/var/lib/postgresql
1010
ports:
1111
- 5432:5432
1212
environment:

0 commit comments

Comments
 (0)