-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (50 loc) · 1.38 KB
/
Copy pathdocker-compose.yml
File metadata and controls
51 lines (50 loc) · 1.38 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
services:
geoparser:
build: .
ports:
- "${PORT:-5000}:5000"
env_file:
- .env
volumes:
# Models and data directories - ensure models are downloaded to these paths
- ./models:/app/models
- ./data:/app/data
# Optional: logs directory for storing logs
- ./logs:/app/logs
restart: unless-stopped
entrypoint: ["/app/entrypoint.sh"]
command: >
gunicorn app.api:app
--bind 0.0.0.0:5000
--workers ${WORKERS}
--timeout ${WORKER_TIMEOUT}
--worker-class ${WORKER_CLASS}
--max-requests ${MAX_REQUESTS}
--max-requests-jitter ${MAX_REQUESTS_JITTER}
--access-logfile -
--error-logfile -
# GPU configuration is optional; enable via an override compose file when needed.
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/api/health"]
interval: 60s
timeout: 30s
retries: 5
start_period: 600s # Allow 10 minutes for models to load
deploy:
resources:
limits:
memory: ${MEMORY_LIMIT}
cpus: '${CPU_LIMIT}'
reservations:
memory: ${MEMORY_RESERVATION}
cpus: '${CPU_RESERVATION}'
logging:
driver: "json-file"
options:
max-size: "${LOG_MAX_SIZE}"
max-file: "${LOG_MAX_FILE}"
networks:
- geoparser_network
networks:
geoparser_network:
driver: bridge