feat: Add initial Docker Compose configuration for API service

This commit is contained in:
2025-10-27 19:46:35 +01:00
parent b56045ca6a
commit a6a5f630cc

39
docker-compose.yml Normal file
View File

@@ -0,0 +1,39 @@
services:
api:
image: ${CALMINER_IMAGE:-calminer-api:latest}
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
env_file:
- config/setup_production.env
environment:
UVICORN_WORKERS: ${UVICORN_WORKERS:-2}
UVICORN_LOG_LEVEL: ${UVICORN_LOG_LEVEL:-info}
command:
[
"sh",
"-c",
"uvicorn main:app --host 0.0.0.0 --port 8000 --workers ${UVICORN_WORKERS:-2} --log-level ${UVICORN_LOG_LEVEL:-info}",
]
ports:
- "${CALMINER_API_PORT:-8000}:8000"
healthcheck:
test:
- "CMD-SHELL"
- 'python -c "import urllib.request; urllib.request.urlopen(''http://127.0.0.1:8000/docs'').read()"'
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
networks:
- calminer_backend
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
networks:
calminer_backend:
driver: bridge