-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.dev-staging.yaml
More file actions
33 lines (31 loc) · 1.2 KB
/
docker-compose.dev-staging.yaml
File metadata and controls
33 lines (31 loc) · 1.2 KB
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
32
33
######################################################################
# Docker compose override file for development + staging environments
######################################################################
services:
postgres:
image: postgres:17 # official Postgres 17 image
container_name: postgres # fixed name for easier links
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_PORT: ${POSTGRES_PORT}
POSTGRES_OPTIONS: ${POSTGRES_OPTIONS}
restart: unless-stopped # auto-restart unless stopped
ports:
- "${POSTGRES_PORT}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data # persist data
networks:
- backend_network
healthcheck: # wait until DB is ready
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
migrator:
depends_on:
postgres:
condition: service_healthy # start after DB is healthy
volumes:
postgres_data: # named volume for PG data