-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
81 lines (74 loc) · 2.75 KB
/
Copy pathdocker-compose.yml
File metadata and controls
81 lines (74 loc) · 2.75 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
# docker-compose.yml
# Full local stack: FastAPI + Redis + Prometheus + Grafana
#
# Usage:
# docker compose up start everything
# docker compose up --build rebuild after code changes
# docker compose down stop everything
#
# After starting:
# FastAPI: http://localhost:8000
# API docs: http://localhost:8000/docs
# Metrics: http://localhost:8000/metrics (raw Prometheus text)
# Prometheus: http://localhost:9090
# Grafana: http://localhost:3001 (login: admin / metricmind)
version: '3.9'
services:
# ── FastAPI Backend ─────────────────────────────────────────────────────────
api:
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
env_file:
- .env
environment:
- DUCKDB_PATH=/app/data/metricmind.duckdb
- REDIS_URL=redis://redis:6379
volumes:
- ./data:/app/data
- ./agent:/app/agent
- ./api:/app/api
- ./catalog:/app/catalog
depends_on:
- redis
command: uvicorn api.main:app --host 0.0.0.0 --port 8000 --reload
restart: unless-stopped
# ── Redis (query result cache) ──────────────────────────────────────────────
redis:
image: redis:7-alpine
ports:
- "6379:6379"
restart: unless-stopped
# ── Prometheus (metrics scraper) ────────────────────────────────────────────
prometheus:
image: prom/prometheus:v2.48.0
ports:
- "9090:9090"
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=7d'
restart: unless-stopped
# ── Grafana (dashboards) ────────────────────────────────────────────────────
grafana:
image: grafana/grafana:10.2.0
ports:
- "3001:3000" # 3001 to avoid conflict with React on 3000
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=metricmind
- GF_USERS_ALLOW_SIGN_UP=false
- GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH=/var/lib/grafana/dashboards/metricmind.json
volumes:
- ./grafana/provisioning:/etc/grafana/provisioning:ro
- ./grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafana-data:/var/lib/grafana
depends_on:
- prometheus
restart: unless-stopped
volumes:
grafana-data: