-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
122 lines (113 loc) · 2.57 KB
/
docker-compose.yaml
File metadata and controls
122 lines (113 loc) · 2.57 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
---
networks:
app: {}
observability: {}
volumes:
grafana-data: {}
postgres-data: {}
prometheus-data: {}
pyroscope-data: {}
services:
# Application services
cook:
build: ./services/cook
environment:
COOK_DB_HOST: toxiproxy
COOK_REDIS_HOST: toxiproxy
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- app
- observability
ports:
- 8080:8080 # application
waiter:
build: ./services/waiter
environment:
COOK_ADDR: http://toxiproxy:8080/api
networks:
- app
- observability
ports:
- 8081:8081
postgres:
image: postgres:17
environment:
POSTGRES_DB: restaurant
POSTGRES_USER: cook
POSTGRES_PASSWORD: c00k
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U cook -d restaurant"
]
interval: 5s
timeout: 5s
retries: 5
networks:
- app
ports:
- 5432:5432
volumes:
- postgres-data:/var/lib/postgresql/data
redis:
image: redis:8.0
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 5s
timeout: 5s
retries: 5
networks:
- app
ports:
- 6379:6379
# Network proxy to simulate latency/jitter
toxiproxy:
image: ghcr.io/shopify/toxiproxy:2.12.0
command: -config /toxiproxy.json
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- app
ports:
- 8474:8474
volumes:
- ./docker/toxiproxy/toxiproxy.json:/toxiproxy.json:ro
# Observability services
grafana:
image: grafana/grafana:12.0.1
environment:
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: "Admin"
GF_AUTH_DISABLE_LOGIN_FORM: "true"
networks:
- observability
ports:
- 3000:3000
volumes:
- ./docker/grafana/provisioning/datasources.yml:/etc/grafana/provisioning/datasources/all.yml:ro
- ./docker/grafana/provisioning/dashboards.yml:/etc/grafana/provisioning/dashboards/all.yml:ro
- ./docker/grafana/dashboards:/opt/dashboards
- grafana-data:/var/lib/grafana
prometheus:
image: prom/prometheus:v3.4.1
networks:
- observability
ports:
- 9090:9090
volumes:
- ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
pyroscope:
image: grafana/pyroscope:1.13.4
networks:
- observability
ports:
- 4040:4040