Change PostgreSQL data directory to /var/lib/postgresql/

Starting with PostgreSQL 18, the data directory (PGDATA)
of the Docker Image has changed to be version specific.
For PostgreSQL 18 it is /var/lib/postgresql/18/docker/.

This means that to persist data, mounts and volumes
should target the new location: /var/lib/postgresql/.

Fixes DioCrafts/OxiCloud#281
This commit is contained in:
Mathieu Boutolleau
2026-04-11 21:39:11 +02:00
parent 1bb65e6448
commit 3e23d9541b
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ services:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- pg_data:/var/lib/postgresql/data
- pg_data:/var/lib/postgresql/
- ./db/schema.sql:/docker-entrypoint-initdb.d/schema.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
+1 -1
View File
@@ -1039,7 +1039,7 @@ services:
networks:
- oxicloud
volumes:
- pg_data:/var/lib/postgresql/data
- pg_data:/var/lib/postgresql/
- ./db/schema.sql:/docker-entrypoint-initdb.d/10-schema.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
+1 -1
View File
@@ -11,7 +11,7 @@ services:
networks:
- oxicloud
volumes:
- pg_data:/var/lib/postgresql/data
- pg_data:/var/lib/postgresql/
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s