-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
130 lines (122 loc) · 3.99 KB
/
Copy pathdocker-compose.yml
File metadata and controls
130 lines (122 loc) · 3.99 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
128
129
130
# Misdirection Proxy — Production Stack
# Full observability: Proxy + Redis + Prometheus + Grafana
#
# Usage:
# docker compose up -d # Start all services
# docker compose logs -f proxy # Watch proxy logs
# docker compose run --rm simulator # Run traffic simulation
# docker compose down # Stop all services
#
# Access points:
# Proxy API: http://localhost:8080
# Prometheus: http://localhost:9090
# Grafana: http://localhost:3000 (admin/admin)
version: "3.9"
services:
# ── Redis Session Store ─────────────────────────────────────
redis:
image: redis:7-alpine
container_name: misdirection-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
networks:
- proxy-network
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
start_period: 5s
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
# ── Misdirection Proxy Gateway ──────────────────────────────
proxy:
build:
context: .
dockerfile: Dockerfile
container_name: misdirection-proxy
ports:
- "8080:8000"
environment:
- REDIS_URL=redis://redis:6379/0
- UPSTREAM_LLM_URL=http://host.docker.internal:11434
depends_on:
redis:
condition: service_healthy
networks:
- proxy-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
# ── Prometheus Metrics Collector ────────────────────────────
prometheus:
image: prom/prometheus:latest
container_name: misdirection-prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
networks:
- proxy-network
restart: unless-stopped
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/etc/prometheus/console_libraries"
- "--web.console.templates=/etc/prometheus/consoles"
- "--web.enable-lifecycle"
depends_on:
- proxy
# ── Grafana Visualization ───────────────────────────────────
grafana:
image: grafana/grafana-oss:latest
container_name: misdirection-grafana
ports:
- "3000:3000"
volumes:
- grafana-data:/var/lib/grafana
networks:
- proxy-network
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
depends_on:
- prometheus
# ── Traffic Simulator (on-demand) ───────────────────────────
# Run with: docker compose run --rm simulator
simulator:
build:
context: .
dockerfile: Dockerfile
container_name: misdirection-simulator
networks:
- proxy-network
profiles:
- simulator
entrypoint: ["python", "scripts/simulate_traffic.py"]
environment:
- PROXY_URL=http://proxy:8000
depends_on:
proxy:
condition: service_healthy
# ── Networks ─────────────────────────────────────────────────
networks:
proxy-network:
driver: bridge
# ── Volumes ─────────────────────────────────────────────────
volumes:
redis-data:
driver: local
prometheus-data:
driver: local
grafana-data:
driver: local