Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
96 lines (85 loc) · 2.62 KB
/
Copy pathcompose.yaml
File metadata and controls
96 lines (85 loc) · 2.62 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
name: routekernel
x-demo: &demo
build:
context: ./apps/demo
restart: unless-stopped
networks: [backend]
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health',timeout=2)"]
interval: 15s
timeout: 3s
retries: 3
start_period: 10s
services:
edge:
image: nginx:1.28-alpine
restart: unless-stopped
ports:
- "${EDGE_HTTP_PORT:-8080}:80"
- "${EDGE_HTTPS_PORT:-8443}:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./nginx/snippets:/etc/nginx/snippets:ro
- ./certs:/etc/nginx/certs:ro
depends_on:
api-a: {condition: service_healthy}
api-b: {condition: service_healthy}
web: {condition: service_healthy}
realtime: {condition: service_healthy}
networks: [frontend, backend, observability]
healthcheck:
test: ["CMD-SHELL", "wget -q -O /dev/null http://127.0.0.1:8081/health || exit 1"]
interval: 15s
timeout: 3s
retries: 3
api-a:
<<: *demo
environment: {APP_ROLE: api, INSTANCE: api-a}
api-b:
<<: *demo
environment: {APP_ROLE: api, INSTANCE: api-b}
web:
<<: *demo
environment: {APP_ROLE: web, INSTANCE: web}
realtime:
<<: *demo
environment: {APP_ROLE: realtime, INSTANCE: realtime}
nginx-exporter:
image: nginx/nginx-prometheus-exporter:1.4.2
command: ["--nginx.scrape-uri=http://edge:8081/stub_status"]
restart: unless-stopped
depends_on: [edge]
networks: [observability]
prometheus:
image: prom/prometheus:v3.5.0
restart: unless-stopped
command: ["--config.file=/etc/prometheus/prometheus.yml", "--storage.tsdb.retention.time=7d"]
volumes:
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
ports:
- "127.0.0.1:9090:9090"
networks: [observability]
grafana:
image: grafana/grafana:12.1.0
restart: unless-stopped
environment:
GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:?Set GRAFANA_ADMIN_PASSWORD in .env}
GF_USERS_ALLOW_SIGN_UP: "false"
volumes:
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafana_data:/var/lib/grafana
ports:
- "127.0.0.1:3000:3000"
depends_on: [prometheus]
networks: [observability]
networks:
frontend: {}
backend: {internal: true}
observability: {internal: true}
volumes:
prometheus_data: {}
grafana_data: {}