Skip to content

Commit 6acaf65

Browse files
committed
Allow setting Postgres through env variables while using Compose
1 parent 6b6cd40 commit 6acaf65

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

docker-compose.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
services:
22
postgres:
3-
image: postgres:17
3+
image: postgres:${POSTGRES_VERSION:-17}
44
environment:
5-
POSTGRES_USER: postgres
6-
POSTGRES_PASSWORD: postgres
7-
POSTGRES_DB: postgres_doctrine_test
5+
POSTGRES_USER: ${POSTGRES_USER:-postgres}
6+
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
7+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
8+
POSTGRES_DB: ${POSTGRES_DB:-postgres_doctrine_test}
89
ports:
9-
- "5432:5432"
10+
- "${POSTGRES_PORT:-5432}:${POSTGRES_PORT:-5432}"
1011
volumes:
1112
- postgres_data:/var/lib/postgresql/data
1213
healthcheck:

0 commit comments

Comments
 (0)