| version: "3.9" | |
| services: | |
| # ββ RAG API βββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| api: | |
| build: . | |
| container_name: smartrag-api | |
| ports: | |
| - "8000:8000" | |
| volumes: | |
| - ./artifacts:/app/artifacts # Persist models + vectorstore | |
| - huggingface_cache:/app/.cache/huggingface | |
| environment: | |
| - MLFLOW_TRACKING_URI=http://mlflow:5000 | |
| deploy: | |
| resources: | |
| reservations: | |
| devices: | |
| - driver: nvidia | |
| count: 1 | |
| capabilities: [gpu] | |
| depends_on: | |
| - mlflow | |
| restart: unless-stopped | |
| healthcheck: | |
| test: ["CMD", "curl", "-f", "http://localhost:8000/health"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 5 | |
| start_period: 90s | |
| # ββ Streamlit UI ββββββββββββββββββββββββββββββββββββββββββββββ | |
| ui: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile.ui | |
| container_name: smartrag-ui | |
| ports: | |
| - "8501:8501" | |
| environment: | |
| - API_BASE=http://api:8000 | |
| depends_on: | |
| api: | |
| condition: service_healthy | |
| restart: unless-stopped | |
| # ββ MLflow Tracking Server ββββββββββββββββββββββββββββββββββββ | |
| mlflow: | |
| image: ghcr.io/mlflow/mlflow:v2.12.0 | |
| container_name: smartrag-mlflow | |
| ports: | |
| - "5000:5000" | |
| volumes: | |
| - mlflow_data:/mlflow | |
| command: > | |
| mlflow server | |
| --host 0.0.0.0 | |
| --port 5000 | |
| --backend-store-uri sqlite:///mlflow/mlflow.db | |
| --default-artifact-root /mlflow/artifacts | |
| restart: unless-stopped | |
| volumes: | |
| huggingface_cache: | |
| mlflow_data: | |