From a6a5f630cc9e02e2ec7f92c290a73bc5cb1c1164 Mon Sep 17 00:00:00 2001 From: zwitschi Date: Mon, 27 Oct 2025 19:46:35 +0100 Subject: [PATCH] feat: Add initial Docker Compose configuration for API service --- docker-compose.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e2ff96c --- /dev/null +++ b/docker-compose.yml @@ -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