-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
105 lines (100 loc) · 2.25 KB
/
docker-compose.prod.yml
File metadata and controls
105 lines (100 loc) · 2.25 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Production Docker Compose Configuration
# Usage: docker-compose -f docker-compose.prod.yml up -d
version: '3.8'
services:
# HEA Webapp Service (Production)
webapp:
build:
context: .
dockerfile: Dockerfile
args:
- BUILDKIT_INLINE_CACHE=1
image: hea-webapp:latest
container_name: hea-webapp-prod
ports:
- "8501:8501"
volumes:
- ./data:/app/data:ro
- ./models:/app/models:ro
- webapp-logs:/app/logs
- ./config:/app/config:ro
environment:
- PYTHONUNBUFFERED=1
- STREAMLIT_SERVER_PORT=8501
- STREAMLIT_SERVER_ADDRESS=0.0.0.0
- STREAMLIT_SERVER_HEADLESS=true
- STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
- LOG_LEVEL=WARNING
networks:
- hea-network
restart: always
deploy:
resources:
limits:
cpus: '2'
memory: 4G
reservations:
cpus: '1'
memory: 2G
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8501/_stcore/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# HEA Backend API Service (Production)
backend:
build:
context: .
dockerfile: backend/Dockerfile
args:
- BUILDKIT_INLINE_CACHE=1
image: hea-backend:latest
container_name: hea-backend-prod
ports:
- "8000:8000"
volumes:
- ./models:/app/models:ro
- ./config:/app/config:ro
- backend-logs:/app/logs
environment:
- PYTHONUNBUFFERED=1
- API_HOST=0.0.0.0
- API_PORT=8000
- LOG_LEVEL=WARNING
- WORKERS=4
networks:
- hea-network
restart: always
deploy:
resources:
limits:
cpus: '2'
memory: 4G
reservations:
cpus: '1'
memory: 2G
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
hea-network:
driver: bridge
volumes:
webapp-logs:
driver: local
backend-logs:
driver: local