-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
58 lines (55 loc) · 1.27 KB
/
docker-compose.yaml
File metadata and controls
58 lines (55 loc) · 1.27 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
49
50
51
52
53
54
55
56
57
58
services:
db:
image: postgres:16-alpine
container_name: todo-db
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: PASSWORD
POSTGRES_DB: todo_db
volumes:
- db-data:/var/lib/postgresql/data
- ./database.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 10s
timeout: 10s
retries: 3
start_period: 10s
backend:
image: kithupag/server:latest
container_name: todo-backend
restart: always
depends_on:
db:
condition: service_healthy
environment:
DB_HOST: db
DB_USER: postgres
DB_PASSWORD: PASSWORD
DB_NAME: todo_db
ports:
- "5000:5000"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:5000/api/todos || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
frontend:
image: kithupag/client:latest
container_name: todo-frontend
restart: always
depends_on:
- backend
ports:
- "80:80"
healthcheck:
test: ["CMD-SHELL", "curl -f http:/localhost || exit 1"]
interval: 30s
timeout: 10s
retries: 3
volumes:
db-data: