-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
211 lines (198 loc) · 5.29 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
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
volumes:
auth_pgdata:
services:
auth:
build:
context: auth
restart: unless-stopped
env_file: ./env_files/auth.env
ports:
- ${KEYCLOAK_PORT:-8090}:8080
command: start-dev
depends_on:
authdb:
condition: service_healthy
authdb:
image: postgres:${AUTH_POSTGRES_VERSION:-14}
restart: unless-stopped
command: "-c fsync=off -c search_path=keycloak,${POSTGRES_USER:-postgres},public"
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
volumes:
- ./auth/initdb:/docker-entrypoint-initdb.d
- auth_pgdata:/var/lib/postgresql/data
user: ${POSTGRES_USER:-postgres}
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
db:
build:
context: db
args:
- POSTGRES_VERSION=${POSTGRES_VERSION:-14}
command: "-c fsync=off -c search_path=midas,${POSTGRES_USER:-postgres},public,postgis"
ports:
- 5432:5432
shm_size: 512mb
restart: unless-stopped
env_file:
- path: ./env_files/db.env
required: true
user: ${POSTGRES_USER:-postgres}
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
migrate:
build:
args:
- GO_VERSION=${GO_VERSION}
- BUILD_TARGET=midas-sql
- BUILD_TAG=local
context: api
env_file:
- path: ./env_files/migrate.env
required: true
command: migrate
depends_on:
db:
condition: service_healthy
api:
build:
args:
- GO_VERSION=${GO_VERSION}
- BUILD_TARGET=midas-api
- BUILD_TAG=local
target: builder
context: api
labels:
- com.host.description=instrumentation-api
entrypoint: go run cmd/midas-api/main.go
restart: unless-stopped
env_file:
- path: ./env_files/api.env
required: true
# the following env files are only needed for running integration tests
# since this container is also the target for the test runner (builder target layer)
- path: ./env_files/dcs-loader.env
required: true
ports:
- "${API_PORT:-8080}:80"
depends_on:
db:
condition: service_healthy
migrate:
condition: service_completed_successfully
elasticmq:
condition: service_started
telemetry:
build:
args:
- GO_VERSION=${GO_VERSION}
- BUILD_TARGET=midas-telemetry
- BUILD_TAG=local
context: api
restart: on-failure
env_file:
- path: ./env_files/telemetry.env
required: true
ports:
- "${TELEMETRY_PORT:-9090}:80"
depends_on:
db:
condition: service_healthy
migrate:
condition: service_completed_successfully
alert:
build:
args:
- GO_VERSION=${GO_VERSION}
- BUILD_TARGET=midas-alert
- BUILD_TAG=local
context: api
env_file:
- path: ./env_files/alert.env
required: true
depends_on:
db:
condition: service_healthy
migrate:
condition: service_completed_successfully
dcs-loader:
build:
args:
- GO_VERSION=${GO_VERSION}
- BUILD_TARGET=midas-dcs-loader
- BUILD_TAG=local
context: api
env_file:
- path: ./env_files/dcs-loader.env
required: true
restart: unless-stopped
depends_on:
elasticmq:
condition: service_started
minio:
image: minio/minio
env_file:
- path: ./env_files/minio.env
required: true
command: server /data --console-address ":9001"
ports:
- ${MINIO_GATEWAY_PORT:-9000}:9000
- ${MINIO_CONSOLE_PORT:-9001}:9001
# configure minio on startup (create buckets, etc)
# inspired by https://github.com/minio/minio/issues/4769
# and https://gist.github.com/haxoza/22afe7cc4a9da7e8bdc09aad393a99cc
minio_init:
image: minio/mc
depends_on:
minio:
condition: service_started
entrypoint: >
/bin/sh -c "
echo 'sleeping for 10 seconds while minio starts...';
sleep 10;
/usr/bin/mc config host add minio http://minio:9000 AKIAIOSFODNN7EXAMPLE wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY;
/usr/bin/mc mb minio/corpsmap-data-incoming minio/corpsmap-data;
/usr/bin/mc policy set public minio/corpsmap-data;
/usr/bin/mc cp --recursive /media/projects/ minio/corpsmap-data/instrumentation/projects/ ;
exit 0;
"
volumes:
- ./data:/media
# report:
# build:
# args:
# - NODE_VERSION=${NODE_VERSION:-22.1}
# - ALPINE_VERSION=${ALPINE_VERSION:-3.19}
# context: report
# network: host
# env_file:
# - path: ./env_files/report.env
# required: true
# security_opt:
# - 'seccomp:./report/chrome/chrome.json'
# depends_on:
# elasticmq:
# condition: service_started
# minio_init:
# condition: service_completed_successfully
elasticmq:
image: softwaremill/elasticmq
volumes:
- ./elasticmq.conf:/opt/elasticmq.conf
restart: unless-stopped
mock_datalogger:
build:
context: mock/telemetry
restart: unless-stopped
depends_on:
telemetry:
condition: service_started
profiles:
- mock