Skip to content

Commit 86aeb10

Browse files
committed
Fix Docker for PostgreSQL
Better fix instead of FreshRSS#8216 Based on error message: 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). 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. See docker-library/postgres#37 for a (long) discussion around this process, and suggestions for how to do so.
1 parent b9abe70 commit 86aeb10

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Docker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ docker network connect freshrss-network postgres
188188

189189
# Otherwise, start a new PostgreSQL instance, remembering to change the passwords:
190190
docker run -d --restart unless-stopped --log-opt max-size=10m \
191-
-v pgsql_data:/var/lib/postgresql/data \
191+
-v pgsql_data:/var/lib/postgresql \
192192
-e POSTGRES_DB=freshrss \
193193
-e POSTGRES_USER=freshrss \
194194
-e POSTGRES_PASSWORD=freshrss \

Docker/freshrss/docker-compose-db.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ services:
1111
options:
1212
max-size: 10m
1313
volumes:
14-
- db:/var/lib/postgresql/18/docker
14+
- db:/var/lib/postgresql
1515
environment:
1616
POSTGRES_DB: ${DB_BASE:-freshrss}
1717
POSTGRES_USER: ${DB_USER:-freshrss}

0 commit comments

Comments
 (0)