-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
54 lines (50 loc) · 1.33 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
54 lines (50 loc) · 1.33 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
services:
db:
container_name: ai_model_db
image: postgres:alpine
restart: always
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
ports:
- '5432:5432'
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
# used in flask container depends_on condition to wait for the DB to be ready
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 20s
retries: 5
ai_model:
container_name: ai_model
build:
context: ./ai_model
dockerfile: ./Dockerfile
ports:
- "5000:5000"
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_HOST=${POSTGRES_HOST}
- SOCKET_SECRET=${SOCKET_SECRET}
command: sh -c "python app.py"
depends_on:
db:
condition: service_healthy
frontend:
container_name: frontend
build:
context: ./frontend
dockerfile: ./Dockerfile
ports:
- "3000:3000"
environment:
- VITE_API_ENDPOINT=${VITE_API_ENDPOINT}
- VITE_SOCKET_ENDPOINT=${VITE_SOCKET_ENDPOINT}
command: sh -c "npm run preview"
volumes:
pgdata: {}