-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
32 lines (29 loc) · 865 Bytes
/
docker-compose.yml
File metadata and controls
32 lines (29 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
services:
postgres:
image: postgres:18-alpine
container_name: ${POSTGRES_CONTAINER_NAME:-postgres}
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_INITDB_ARGS: ${POSTGRES_INITDB_ARGS:--encoding=UTF8 --locale=C}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:${POSTGRES_DATA_PATH:-/var/lib/postgresql}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- postgres_network
volumes:
postgres_data:
driver: local
name: ${POSTGRES_VOLUME_NAME:-postgres_data}
networks:
postgres_network:
driver: bridge
name: ${POSTGRES_NETWORK_NAME:-postgres_network}