-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
48 lines (46 loc) · 1.06 KB
/
docker-compose.yml
File metadata and controls
48 lines (46 loc) · 1.06 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
services:
postgres:
image: postgres:18.3
container_name: postgres_db
restart: unless-stopped
env_file:
- .env
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- "${POSTGRES_PORT}:5432"
volumes:
- ./data/postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 1m
retries: 5
start_period: 30s
migrate:
build:
context: .
dockerfile: Dockerfile.migrate
container_name: migrate
depends_on:
postgres:
condition: service_healthy
env_file:
- .env
restart: no
app:
build:
context: .
dockerfile: Dockerfile.app
container_name: app
depends_on:
migrate:
condition: service_completed_successfully
postgres:
condition: service_healthy
env_file:
- .env
restart: unless-stopped