-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
127 lines (121 loc) · 4.46 KB
/
Copy pathdocker-compose.yml
File metadata and controls
127 lines (121 loc) · 4.46 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
117
118
119
120
121
122
123
124
125
126
127
# Comio — Local Development Environment
# Start: docker compose up -d
# Stop: docker compose down
# Reset: docker compose down -v (wipes all data)
# Logs: docker compose logs -f postgres
services:
# ─── PostgreSQL Database ─────────────────────────────────────
# Stores all application data: projects, incidents, users, deployments,
# chat history, AI diagnoses, etc.
# Uses pgvector extension for storing AI embeddings (needed for RAG search).
postgres:
image: pgvector/pgvector:pg16
container_name: comio-postgres
restart: unless-stopped
environment:
POSTGRES_USER: comio
POSTGRES_PASSWORD: comio
POSTGRES_DB: comio
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U comio"]
interval: 10s
timeout: 5s
retries: 5
# ─── Redis ───────────────────────────────────────────────────
# In-memory data store used for:
# - Caching LLM responses (save money by not re-calling for same queries)
# - Rate limiting API requests
# - Pub/Sub events (real-time incident notifications, deploy status)
# - Storing anomaly detection model state
# - Session data
redis:
image: redis:7-alpine
container_name: comio-redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# ─── Demo Order API ──────────────────────────────────────────
# Simulated e-commerce service for testing monitoring/alerting.
# Includes chaos endpoints to trigger failures on demand.
demo-app:
build:
context: .
dockerfile: docker/Dockerfile.demo-app
container_name: comio-demo-app
restart: unless-stopped
ports:
- "8001:8000"
environment:
- LOG_LEVEL=INFO
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 15s
timeout: 5s
retries: 3
depends_on:
- prometheus
# ─── Prometheus ──────────────────────────────────────────────
# Metrics collection and storage. Scrapes /metrics endpoints
# from demo-app and Comio API. Evaluates alerting rules.
prometheus:
image: prom/prometheus:v2.51.0
container_name: comio-prometheus
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- ./infra/observability/prometheus.yml:/etc/prometheus/prometheus.yml
- ./infra/observability/alert_rules.yml:/etc/prometheus/alert_rules.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=30d'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:9090/-/healthy"]
interval: 15s
timeout: 5s
retries: 3
# ─── Alertmanager ────────────────────────────────────────────
# Handles alerts from Prometheus. Routes them to webhooks,
# Slack, PagerDuty, etc. We configure it to send to Comio API.
alertmanager:
image: prom/alertmanager:v0.27.0
container_name: comio-alertmanager
restart: unless-stopped
ports:
- "9093:9093"
volumes:
- ./infra/observability/alertmanager.yml:/etc/alertmanager/alertmanager.yml
- alertmanager_data:/alertmanager
command:
- '--config.file=/etc/alertmanager/alertmanager.yml'
- '--storage.path=/alertmanager'
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:9093/-/healthy"]
interval: 15s
timeout: 5s
retries: 3
depends_on:
- prometheus
# Named volumes — Docker manages the storage location.
# Data persists across container restarts.
# Run `docker compose down -v` to wipe everything and start fresh.
volumes:
postgres_data:
redis_data:
prometheus_data:
alertmanager_data: