-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
89 lines (82 loc) · 2.95 KB
/
Copy pathdocker-compose.yml
File metadata and controls
89 lines (82 loc) · 2.95 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
# Local development stack: gateway + backing stores + demo upstreams +
# observability. `make up` brings it all up; `make seed` loads demo tenants.
name: tollgate
services:
redis:
image: redis:7-alpine
ports: ["6379:6379"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 2s
timeout: 2s
retries: 15
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: tollgate
POSTGRES_PASSWORD: tollgate
POSTGRES_DB: tollgate
ports: ["5432:5432"]
healthcheck:
test: ["CMD-SHELL", "pg_isready -U tollgate"]
interval: 2s
timeout: 2s
retries: 15
upstream-a:
build: { context: ., target: upstream }
environment:
BASE_DELAY_MS: "5"
JITTER_MS: "10"
upstream-b:
build: { context: ., target: upstream }
environment:
BASE_DELAY_MS: "20"
JITTER_MS: "30"
gateway:
build: { context: ., target: gateway }
environment:
DATABASE_URL: postgres://tollgate:tollgate@postgres:5432/tollgate
REDIS_ADDR: redis:6379
RATE_LIMITER: redis
OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4318
TRACE_SAMPLE_RATIO: "0.2"
ACCESS_LOG_SAMPLE: "1"
LOG_LEVEL: info
# The same reason it exists for a PaaS applies here: this image is
# distroless, so nothing inside the container can apply a .sql file, and
# `make up` brings the gateway up against a Postgres volume that has
# never been migrated. Without this the gateway exits at boot with
# `relation "tenants" does not exist`, `make up` still reports success,
# and the console it just advertised refuses the connection. `make seed`
# cannot rescue it either, because it issues keys through
# `docker compose exec gateway`.
AUTO_MIGRATE: "true"
# Management console + API at /_admin/. Unset it and the whole surface
# disappears; this local default is not a secret and must not be reused
# anywhere reachable.
ADMIN_TOKEN: ${ADMIN_TOKEN:-local-dev-admin-token-change-me}
# Shared provider credentials for routes using upstream auth injection
# (-auth-env). Set them in your host shell; empty is fine otherwise.
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
DEMO_PROVIDER_KEY: ${DEMO_PROVIDER_KEY:-}
ports:
- "8080:8080" # proxy
- "9090:9090" # admin: /metrics /healthz /readyz /debug/pprof
depends_on:
redis: { condition: service_healthy }
postgres: { condition: service_healthy }
upstream-a: { condition: service_started }
upstream-b: { condition: service_started }
prometheus:
image: prom/prometheus:v2.53.0
volumes:
- ./deploy/monitoring/prometheus-local.yml:/etc/prometheus/prometheus.yml:ro
ports: ["9091:9090"]
jaeger:
image: jaegertracing/all-in-one:1.58
environment:
COLLECTOR_OTLP_ENABLED: "true"
ports:
- "16686:16686" # UI
- "4318:4318" # OTLP HTTP