-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
116 lines (109 loc) · 3.41 KB
/
Copy pathdocker-compose.yml
File metadata and controls
116 lines (109 loc) · 3.41 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
services:
# ---------------------------------------------------------------------------
# PostgreSQL
# ---------------------------------------------------------------------------
db:
image: postgres:16-alpine
environment:
POSTGRES_DB: llm_studio
POSTGRES_USER: llm_studio
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./db/schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U llm_studio"]
interval: 10s
timeout: 5s
retries: 5
# ---------------------------------------------------------------------------
# MLflow tracking server
# ---------------------------------------------------------------------------
mlflow:
image: python:3.11-slim
working_dir: /mlflow
command: >
bash -c "pip install 'mlflow[extras]' --quiet &&
mlflow server
--host 0.0.0.0
--port 5000
--backend-store-uri sqlite:///mlflow.db
--default-artifact-root /mlflow/artifacts"
ports:
- "5001:5000"
volumes:
- mlflow_data:/mlflow
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/health')"]
interval: 15s
timeout: 10s
retries: 10
start_period: 120s
# ---------------------------------------------------------------------------
# LLM Studio API
# ---------------------------------------------------------------------------
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
environment:
DATABASE_URL: postgresql://llm_studio:${POSTGRES_PASSWORD:-changeme}@db:5432/llm_studio
MLFLOW_TRACKING_URI: sqlite:////mlflow/mlflow.db
STORAGE_BASE: /app/storage
volumes:
- app_storage:/app/storage
- mlflow_data:/mlflow
depends_on:
db:
condition: service_healthy
# ---------------------------------------------------------------------------
# Frontend (Next.js)
# ---------------------------------------------------------------------------
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
NEXT_PUBLIC_API_URL: http://localhost:8000
ports:
- "3001:3001"
depends_on:
- app
# ---------------------------------------------------------------------------
# Prometheus
# ---------------------------------------------------------------------------
prometheus:
image: prom/prometheus:latest
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.enable-lifecycle"
# ---------------------------------------------------------------------------
# Grafana
# ---------------------------------------------------------------------------
grafana:
image: grafana/grafana:latest
ports:
- "3000:3000"
environment:
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD:-admin}
GF_USERS_ALLOW_SIGN_UP: "false"
volumes:
- grafana_data:/var/lib/grafana
depends_on:
- prometheus
volumes:
postgres_data:
mlflow_data:
app_storage:
prometheus_data:
grafana_data: