-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.staging.yml
executable file
·215 lines (211 loc) · 5 KB
/
docker-compose.staging.yml
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
version: '3.9'
services:
gateway:
container_name: gateway
build:
context: ./
dockerfile: ./.docker/api_gateway/Dockerfile
environment:
APP_ENV: staging
ports:
- "8011:8011"
- "8012:8012"
volumes:
- ./:/interview
- ./build/keys/server.crt:/etc/ssl/certs/server.crt
- ./build/keys/server.key:/etc/ssl/private/server.key
depends_on:
- jaeger
- auth_service
- user_service
networks:
interview-net:
aliases:
- igateway
auth_service:
container_name: auth_service
build:
context: ./
dockerfile: ./.docker/auth_service/Dockerfile
environment:
APP_ENV: staging
ports:
- "8021:8021"
- "8022:8022"
volumes:
- ./:/interview
depends_on:
mongo:
condition: service_started
cache:
condition: service_started
jaeger:
condition: service_started
rabbitmq:
condition: service_healthy
networks:
interview-net:
aliases:
- iauth_service
user_service:
container_name: user_service
build:
context: ./
dockerfile: ./.docker/user_service/Dockerfile
environment:
APP_ENV: staging
ports:
- "8031:8031"
- "8032:8032"
volumes:
- ./:/interview
networks:
interview-net:
aliases:
- iuser_service
consumer_service:
container_name: consumer_service
build:
context: ./
dockerfile: ./.docker/consumer_service/Dockerfile
env_file: .env
depends_on:
rabbitmq:
condition: service_healthy
volumes:
- ./:/interview
networks:
interview-net:
aliases:
- iconsumer_service
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: rabbitmq
environment:
- RABBITMQ_DEFAULT_USER=interview
- RABBITMQ_DEFAULT_PASS=interview
- RABBITMQ_DEFAULT_VHOST=interview
ports:
- "5672:5672"
- "15672:15672"
- "15692:15692"
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 1s
timeout: 3s
retries: 30
volumes:
- ./.docker/rabbitmq/rabbitmq.conf:/etc/rabbitmq/rabbitmq.config:ro
- ./.docker/rabbitmq/definitions.json:/etc/rabbitmq/definitions.json:ro
networks:
interview-net:
aliases:
- irabbitmq
prometheus:
image: prom/prometheus:latest
container_name: prometheus
ports:
- "9090:9090"
command:
- --config.file=/etc/prometheus/prometheus.yml
volumes:
- ./.docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
healthcheck:
test: [ "CMD", "wget", "http://localhost:9090" ]
interval: 10s
timeout: 15s
retries: 10
networks:
interview-net:
aliases:
- iprometheus
grafana:
image: grafana/grafana:latest
container_name: grafana
volumes:
- ./.docker/grafana/grafana.ini:/etc/grafana/grafana.ini
- ./.docker/grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yaml
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
ports:
- 3000:3000
healthcheck:
test: [ "CMD-SHELL", "curl -f localhost:3000/api/health && echo 'ready'" ]
interval: 10s
retries: 30
networks:
interview-net:
aliases:
- igrafana
jaeger:
image: jaegertracing/all-in-one:1.46
container_name: jaeger
environment:
- COLLECTOR_ZIPKIN_HTTP_PORT=9411
- COLLECTOR_OTLP_ENABLED=true
- METRICS_STORAGE_TYPE=prometheus
- PROMETHEUS_SERVER_URL=http://prometheus:9090
- LOG_LEVEL=debug
- PROMETHEUS_QUERY_SUPPORT_SPANMETRICS_CONNECTOR=true
- PROMETHEUS_QUERY_NAMESPACE=span_metrics
- PROMETHEUS_QUERY_DURATION_UNIT=s
ports:
- "5775:5775/udp"
- "5778:5778"
- "6831:6831/udp"
- "6832:6832/udp"
- "9411:9411"
- "14250:14250"
- "14268:14268"
- "16686:16686"
networks:
interview-net:
aliases:
- ijaeger
mongo:
image: mongo
container_name: mongo
restart: always
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: interview
MONGO_INITDB_ROOT_PASSWORD: interview
networks:
interview-net:
aliases:
- imongo
cache:
container_name: cacheable
image: redis:7-alpine
restart: always
ports:
- '6379:6379'
command: redis-server --save 60 1 --loglevel warning
volumes:
- cacheable:/data
networks:
interview-net:
aliases:
- icache
mailhog:
image: mailhog/mailhog
container_name: mailhog
ports:
- "1025:1025" # smtp server
- "8025:8025" # web ui
networks:
interview-net:
aliases:
- imailhog
volumes:
cache:
driver: local
pg-data:
networks:
interview-net:
name: interview-net
driver: bridge
enable_ipv6: false