Skip to content

Commit b44135e

Browse files
authored
chore(templates): fix postgres volume (#15157)
* from the docker hub readme: Important Note: (for PostgreSQL 17 and below) Mount the data volume at /var/lib/postgresql/data and not at /var/lib/postgresql because mounts at the latter path WILL NOT PERSIST database data when the container is re-created. The Dockerfile that builds the image declares a volume at /var/lib/postgresql/data and if no data volume is mounted at that path then the container runtime will automatically create an anonymous volume that is not reused across container re-creations. Data will be written to the anonymous volume rather than your intended data volume and won't persist when the container is deleted and re-created. ### What? Fixes database volume in docker compose for the postgres template. ### Why? The latest major version of docker postgres is now v18.
1 parent da27afc commit b44135e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/with-postgres/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ services:
2121
restart: always
2222
image: postgres:latest
2323
volumes:
24-
- pgdata:/var/lib/postgresql/data
24+
- pgdata:/var/lib/postgresql
2525
ports:
2626
- '5432:5432'
2727
environment:

0 commit comments

Comments
 (0)