Skip to content

Commit 4855218

Browse files
Fix docker compose postgres volume path (#583)
Fix docker compose postgres volume Partial revert of ac586b1. The compose files previously used the mountpoint for postgres 18 containers (/var/lib/postgresql) on a postgres 17 container. Since the actual mountpoint, defined in the image as /var/lib/postgresql/data, is still free, a new unnamed volume was created for each container, resetting the database with every `docker compose down`. Also locks the container version in the dev setup because the path will need to be changed back once the custom image is updated to postgres 18.
1 parent ff28d4c commit 4855218

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docker/dev/compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: split-pro-dev
22

33
services:
44
postgres:
5-
image: ossapps/postgres
5+
image: ossapps/postgres:17.7-trixie
66
container_name: ${POSTGRES_CONTAINER_NAME:-splitpro-db}
77
restart: always
88
environment:
@@ -11,7 +11,7 @@ services:
1111
- POSTGRES_DB=${POSTGRES_DB:-splitpro}
1212
- POSTGRES_PORT=${POSTGRES_PORT:-5432}
1313
volumes:
14-
- database:/var/lib/postgresql
14+
- database:/var/lib/postgresql/data
1515
command: >
1616
postgres
1717
-c shared_preload_libraries=pg_cron

docker/prod/compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ services:
2424
# - "5432:5432"
2525
env_file: .env
2626
volumes:
27-
- database:/var/lib/postgresql
27+
- database:/var/lib/postgresql/data
2828

2929
splitpro:
3030
image: ossapps/splitpro:latest

0 commit comments

Comments
 (0)