Credid-Card-Fraud-Detection / docker-compose.yml
Zalaid's picture
Step 9: add Docker containerization
fa70c82
version: "3.9"
services:
# ─── Fraud Detection API ────────────────────────────────────────────────────
api:
build: .
container_name: fraud-api
ports:
- "8000:8000"
healthcheck:
test: ["CMD", "python", "-c",
"import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 30s
timeout: 10s
retries: 3
# ─── MLflow Tracking UI (local development only) ───────────────────────────
mlflow:
image: python:3.11-slim
container_name: fraud-mlflow
working_dir: /app
volumes:
- ./mlruns:/app/mlruns
ports:
- "5000:5000"
command: >
bash -c "pip install mlflow --quiet &&
mlflow ui
--backend-store-uri sqlite:///mlruns/mlflow.db
--host 0.0.0.0
--port 5000"