-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
144 lines (137 loc) · 3.51 KB
/
docker-compose.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
version: '3.5'
name: pokeshop
services:
db:
image: postgres:14
# ports:
# - 5434:5432
environment:
POSTGRES_USER: ashketchum
POSTGRES_PASSWORD: squirtle123
POSTGRES_DB: pokeshop
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB']
interval: 1s
timeout: 5s
retries: 60
cache:
image: redis:6
# ports:
# - 6379:6379
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 1s
timeout: 3s
retries: 60
queue:
image: rabbitmq:3.12
restart: unless-stopped
# ports:
# - 5672:5672
# - 15672:15672
healthcheck:
test: rabbitmq-diagnostics -q check_running
interval: 1s
timeout: 5s
retries: 60
jaeger:
image: jaegertracing/all-in-one:latest
ports:
- 14250:14250
- 16685:16685
- 16686:16686
healthcheck:
test: ['CMD', 'wget', '--spider', 'localhost:16686']
interval: 1s
timeout: 3s
retries: 60
otel-collector:
image: otel/opentelemetry-collector-contrib:0.100.0
restart: unless-stopped
extra_hosts:
- 'host.docker.internal:host-gateway'
command:
- '--config'
- '/otel-local-config.yaml'
volumes:
- ./collector.config.yaml:/otel-local-config.yaml
depends_on:
jaeger:
condition: service_healthy
api:
build: .
environment:
REDIS_URL: cache
DATABASE_URL: postgresql://ashketchum:squirtle123@db:5432/pokeshop?schema=public
RABBITMQ_HOST: queue
POKE_API_BASE_URL: https://pokeapi.co/api/v2
COLLECTOR_ENDPOINT: http://otel-collector:4317
ZIPKIN_URL: http://localhost:9411
healthcheck:
test: ['CMD', 'wget', '--spider', 'localhost:8081/pokemon/healthcheck']
interval: 1m
timeout: 3s
retries: 60
ports:
- 8081:8081
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
queue:
condition: service_healthy
jaeger:
condition: service_healthy
otel-collector:
condition: service_started
rpc:
build: .
environment:
REDIS_URL: cache
DATABASE_URL: postgresql://ashketchum:squirtle123@db:5432/pokeshop?schema=public
RABBITMQ_HOST: queue
POKE_API_BASE_URL: https://pokeapi.co/api/v2
COLLECTOR_ENDPOINT: http://otel-collector:4317
ZIPKIN_URL: http://localhost:9411
NPM_RUN_COMMAND: rpc
healthcheck:
test: ['CMD', 'wget', '--spider', 'localhost:8081/pokemon/healthcheck']
interval: 1m
timeout: 3s
retries: 60
ports:
- 8082:8082
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
queue:
condition: service_healthy
jaeger:
condition: service_healthy
otel-collector:
condition: service_started
worker:
build: .
environment:
REDIS_URL: cache
DATABASE_URL: postgresql://ashketchum:squirtle123@db:5432/pokeshop?schema=public
RABBITMQ_HOST: queue
POKE_API_BASE_URL: https://pokeapi.co/api/v2
COLLECTOR_ENDPOINT: http://otel-collector:4317
ZIPKIN_URL: http://localhost:9411
NPM_RUN_COMMAND: worker
SERVICE_NAME: pokeshop-worker
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
queue:
condition: service_healthy
jaeger:
condition: service_healthy
otel-collector:
condition: service_started