-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
62 lines (62 loc) · 1.31 KB
/
docker-compose.yaml
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
59
60
61
62
version: "3.8"
services:
frontend:
env_file: .env
build:
context: ./src/web
dockerfile: Dockerfile
restart: unless-stopped
container_name: frontend
ports:
- 80:80
networks:
- network
depends_on:
backend:
condition: service_healthy
backend:
env_file: .env
build:
context: .
dockerfile: ./src/api/Dockerfile
restart: unless-stopped
container_name: backend
ports:
- 8000:8000
networks:
- network
depends_on:
database:
condition: service_healthy
healthcheck:
test: curl --fail http://localhost:8000/api/monitor || exit 1
interval: 5s
timeout: 10s
retries: 10
volumes:
- ${PWD}/model.joblib:/home/app/app/model.joblib
database:
env_file: .env
container_name: database
image: postgres:15-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- network
restart: on-failure
healthcheck:
test: pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}
interval: 5s
timeout: 10s
retries: 10
volumes:
pgdata:
networks:
network:
driver: bridge