-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
39 lines (38 loc) · 1.47 KB
/
Copy pathdocker-compose.yml
File metadata and controls
39 lines (38 loc) · 1.47 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
# =============================================================================
# docker/docker-compose.yml — Local deployment of the prediction service
# =============================================================================
# Usage:
# docker compose -f docker/docker-compose.yml up --build
#
# Prerequisites:
# - At least one model promoted to Production via the pipeline.
# - A .env file in the project root (copy from .env.example).
# =============================================================================
services:
prediction-api:
build:
context: ..
dockerfile: docker/Dockerfile
container_name: mlops-prediction-api
ports:
- "${API_PORT:-8000}:8000"
volumes:
# Read-only mount of the MLflow tracking store for model loading.
- ../mlruns:/app/mlruns:ro
# Read-only mount of config files so deployment.yaml and pipeline configs
# can be read at runtime without baking them into the image.
- ../src/config:/app/src/config:ro
# Read-only mount of model artifacts for joblib-based model loading.
- ../artifacts:/app/artifacts:ro
- ../data/processed:/app/data/processed:ro
env_file:
- ../.env
environment:
- MLFLOW_TRACKING_URI=/app/mlruns
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 30s
timeout: 5s
start_period: 60s
retries: 3