-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
177 lines (174 loc) · 4.26 KB
/
docker-compose.yaml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: performance-workshop
services:
router-init:
image: &routerImage ghcr.io/apollographql/router:v1.55.0
user: root
entrypoint:
- 'chown'
- '1000:1000'
- '/var/log/router'
volumes:
- router-logs:/var/log/router
router:
image: ghcr.io/apollographql/router:v1.55.0
environment:
- APOLLO_KEY=add-your-apollo-key-here
- APOLLO_GRAPH_REF=add-your-graph-ref-here
entrypoint:
- '/etc/router/.router/bootstrap.sh'
ports:
- '4000:4000'
volumes:
- ${PWD}/router:/etc/router
- router-logs:/var/log/router
deploy:
resources:
limits:
cpus: '2.0'
labels:
- dev.dozzle.name=router
- dev.dozzle.group=apollo
- loggable
depends_on:
- router-init
- redis
- tempo
accounts:
build: ./starstuff-services/accounts
ports:
- 4001:4001
inventory:
build: ./starstuff-services/inventory
ports:
- 4004:4004
products:
build: ./starstuff-services/products
ports:
- 4003:4003
reviews:
build: ./starstuff-services/reviews
ports:
- 4002:4002
subgraphs:
image: alpine:latest
entrypoint:
- '/etc/subgraphs/subgraphs.sh'
volumes:
- ${PWD}/subgraphs:/etc/subgraphs
- ${PWD}/router:/etc/router:rw
labels:
- dev.dozzle.name=subgraphs
- dev.dozzle.group=apollo
- loggable
code-server:
image: codercom/code-server:latest
ports:
- '8080:8080'
environment:
- VSCODE_PROXY_URI=
entrypoint:
- '/home/coder/.config/bootstrap.sh'
volumes:
- ${PWD}/code-server/.config:/home/coder/.config
- ${PWD}/router:/etc/router:rw
prometheus:
image: prom/prometheus
# ports:
# - "9090:9090"
command:
- --config.file=/etc/prometheus/prometheus.yaml
- --web.enable-remote-write-receiver
volumes:
- ${PWD}/prometheus:/etc/prometheus
restart: always
grafana:
image: grafana/grafana-oss
ports:
- '3000:3000'
volumes:
- ${PWD}/grafana/grafana.ini:/etc/grafana/grafana.ini
- ${PWD}/grafana/provisioning:/etc/grafana/provisioning
# Dozzle is infinitely better than grafana for viewing logs, but for demo purposes grafana can be configured to watch for certain log events.
# dozzle:
# image: amir20/dozzle
# command:
# - --mode
# - server
# - --filter
# - label=loggable
# - --no-analytics
# ports:
# - "8081:8080"
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# healthcheck:
# test: curl --fail http://localhost:8081/ || exit 1
# interval: 1s
# timeout: 1s
# retries: 3
# start_period: 60s
# Tempo runs as user 10001, and docker compose creates the volume as root.
# As such, we need to chown the volume in order for Tempo to start correctly.
init-tempo:
image: &tempoImage grafana/tempo:latest
user: root
entrypoint:
- 'chown'
- '10001:10001'
- '/var/tempo'
volumes:
- tempo-data:/var/tempo
tempo:
image: *tempoImage
command: ['-config.file=/etc/tempo/tempo.yaml']
# ports:
# - 3200:3200
volumes:
- ${PWD}/tempo:/etc/tempo
- tempo-data:/var/tempo
depends_on:
- init-tempo
restart: always
init-loki:
image: &lokiImage grafana/loki:latest
user: root
entrypoint:
- '/etc/loki/loki.sh'
volumes:
- ${PWD}/loki:/etc/loki
- loki-data:/tmp/loki:rw
loki:
image: *lokiImage
ports:
- 3100:3100
command:
- -config.file=/etc/loki/loki.yaml
volumes:
- ${PWD}/loki:/etc/loki
- loki-data:/tmp/loki:rw
depends_on:
- init-loki
restart: always
promtail:
image: grafana/promtail:latest
volumes:
- ${PWD}/promtail:/etc/promtail
- router-logs:/var/log/router
command: -config.file=/etc/promtail/promtail.yaml
restart: always
redis:
image: redis:7.4
ports:
- 6379:6379
vegeta:
image: jauderho/vegeta
depends_on:
- router
volumes:
- ${PWD}/vegeta:/etc/vegeta
command: attack -targets=/etc/vegeta/targets.http -rate=500 -timeout 10s -duration=0 -output=/dev/null
# restart: always
volumes:
tempo-data:
loki-data:
router-logs: