-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
314 lines (294 loc) · 11.4 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
314 lines (294 loc) · 11.4 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
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
services:
db:
image: postgres:15
container_name: direct-file-db
restart: always
# the postgres docker image defaults to uid and gid 999, optionally override it with our env vars
user: "${DF_DB_USER_ID:-999}:${DF_DB_GROUP_ID:-999}"
entrypoint: "/bin/bash"
command: -c "chown -R ${DF_DB_USER_ID:-999}:${DF_DB_GROUP_ID:-999} /var/lib/postgresql/data & exec /usr/local/bin/docker-entrypoint.sh postgres"
environment: &dbuser
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8"
volumes:
- "./docker/db/postgres/init:/docker-entrypoint-initdb.d:ro"
- "./docker/db/postgres/data:/var/lib/postgresql/data"
ports:
- "${DF_LISTEN_ADDRESS:-127.0.0.1}:${DF_DB_PORT:-5435}:5432"
healthcheck: &dbhealth
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
start_period: 60s
stop_grace_period: 60s
state-api-db:
image: postgres:15
container_name: state-api-db
restart: always
# the postgres docker image defaults to uid and gid 999, optionally override it with our env vars
user: "${STATEAPI_DB_USER_ID:-999}:${STATEAPI_DB_GROUP_ID:-999}"
entrypoint: "/bin/bash"
command: -c "chown -R ${DF_DB_USER_ID:-999}:${DF_DB_GROUP_ID:-999} /var/lib/postgresql/data & exec /usr/local/bin/docker-entrypoint.sh postgres"
environment: *dbuser
volumes:
- "./direct-file/state-api/docker/db/postgres/init:/docker-entrypoint-initdb.d:ro"
- "./direct-file/state-api/docker/db/postgres/data:/var/lib/postgresql/data"
ports:
- "${DF_LISTEN_ADDRESS:-127.0.0.1}:${STATEAPI_DB_PORT:-5433}:5432"
healthcheck: *dbhealth
stop_grace_period: 60s
email-service-db:
image: postgres:15
container_name: email-service-db
restart: always
# the postgres docker image defaults to uid and gid 999, optionally override it with our env vars
user: "${DF_EMAIL_DB_USER_ID:-999}:${DF_EMAIL_DB_GROUP_ID:-999}"
entrypoint: "/bin/bash"
command: -c "chown -R ${DF_DB_USER_ID:-999}:${DF_DB_GROUP_ID:-999} /var/lib/postgresql/data & exec /usr/local/bin/docker-entrypoint.sh postgres"
environment: *dbuser
volumes:
- "./direct-file/email-service/docker/db/postgres/init:/docker-entrypoint-initdb.d:ro"
- "./direct-file/email-service/docker/db/postgres/data:/var/lib/postgresql/data"
ports:
- "${DF_LISTEN_ADDRESS:-127.0.0.1}:${DF_EMAIL_DB_PORT:-5434}:5432"
healthcheck: *dbhealth
stop_grace_period: 60s
profiles:
- extras
api:
container_name: direct-file-api
build:
context: ./direct-file/backend
dockerfile: Dockerfile-local
additional_contexts:
factgraph-repo: ./direct-file/fact-graph-scala
shared-libs: ./direct-file/libs
boms: ./direct-file/boms
config: ./direct-file/config
scripts: ./scripts
args:
MAVEN_OPTS: "${MAVEN_OPTS:-}"
read_only: true
environment:
SPRING_PROFILES_ACTIVE: development,docker
DF_API_PORT: "${DF_API_PORT:-5000}"
DF_API_PUBLIC_PATH: "/df/file/api"
DF_FE_PORT: "${DF_FE_PORT:-3000}"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4317"
JAVA_TOOL_OPTIONS: "${JAVA_TOOL_OPTIONS:-}"
OTEL_SERVICE_NAME: "direct-file-api"
LOCAL_WRAPPING_KEY: "${LOCAL_WRAPPING_KEY:-oE3Pm+fr1I+YbX2ZxEe/n9INqJjy00KSl7oXXW4p5Xw=}"
DF_SUBMIT_PORT: "${DF_SUBMIT_PORT:-8083}"
GIT_COMMIT_HASH: "${GIT_COMMIT_HASH:-}"
DF_TIN_VALIDATION_ENABLED: ${DF_TIN_VALIDATION_ENABLED:-true}
DF_EMAIL_VALIDATION_ENABLED: ${DF_EMAIL_VALIDATION_ENABLED:-true}
SUBMIT_EFIN: ${SUBMIT_EFIN:-333333}
SUBMIT_EFIN_ERO: ${SUBMIT_EFIN_ERO:-444444}
SUBMIT_ID_VAR_CHARS: ${SUBMIT_ID_VAR_CHARS:-do}
volumes:
- type: tmpfs
target: /tmp
depends_on:
db:
condition: service_healthy
localstack:
condition: service_healthy
redis:
condition: service_started
ports:
- "${DF_LISTEN_ADDRESS:-127.0.0.1}:${DF_API_PORT:-8080}:${DF_API_PORT:-8080}"
csp-simulator:
container_name: direct-file-csp-simulator
build:
context: ./utils/csp-simulator
environment:
FLASK_RUN_HOST: "0.0.0.0"
FLASK_SECRET_KEY: "not-so-secret-secret-key"
CSPSIM_BACKEND_BASE_URL: "http://host.docker.internal:${DF_API_PORT:-8080}"
CSPSIM_BACKEND_BASE_PATH: "${DF_API_PUBLIC_PATH:-/df/file/api}"
CSPSIM_CLIENT_BASE_URL: "http://host.docker.internal:${DF_FE_PORT:-3000}"
CSPSIM_CLIENT_BASE_PATH: "${DF_CLIENT_PUBLIC_PATH:-/df/file}"
CSPSIM_DATABASE_FILE: "/tmp/csp_simulator.sqlite3"
CSPSIM_FAKE_PUBLIC_IP_ADDRESS_TO_PREPEND_TO_X_FORWARDED_FOR: "${CSPSIM_FAKE_PUBLIC_IP_ADDRESS_TO_PREPEND_TO_X_FORWARDED_FOR:-76.122.220.120}"
ports:
- "${DF_LISTEN_ADDRESS:-127.0.0.1}:${DF_CSPSIM_PORT:-5000}:8080"
extra_hosts:
- "host.docker.internal:host-gateway"
profiles:
- extras
screener:
container_name: direct-file-screener
build:
context: ./direct-file/df-client
dockerfile: Dockerfile-static-site-local
args:
ENABLE_SCREENER_EGAIN_CHAT: "0"
ENABLE_SCREENER_EGAIN_CHAT_NON_PROD: "0"
ports:
- "${DF_LISTEN_ADDRESS:-127.0.0.1}:${DF_SCREENER_PORT:-3500}:3500"
df-client:
container_name: direct-file-app
build:
context: ./direct-file/df-client
dockerfile: Dockerfile-local
additional_contexts:
backend: ./direct-file/backend
args:
DF_CLIENT_PUBLIC_PATH: "/df/file"
DF_API_PUBLIC_PATH: "/df/file/api"
DF_API_PORT: "${DF_CSPSIM_PORT:-8080}"
ENABLE_EGAIN_CHAT: "0"
ports:
- "${DF_LISTEN_ADDRESS:-127.0.0.1}:${DF_FE_PORT:-3000}:3000"
email-service:
container_name: direct-file-email-service
build:
context: ./direct-file/email-service
dockerfile: Dockerfile-local
additional_contexts:
factgraph-repo: ./direct-file/fact-graph-scala
shared-libs: ./direct-file/libs
boms: ./direct-file/boms
config: ./direct-file/config
args:
MAVEN_OPTS: "${MAVEN_OPTS:-}"
read_only: true
environment:
SMTP_USERNAME: "${SMTP_USERNAME:-}"
SMTP_PASSWORD: "${SMTP_PASSWORD:-}"
SPRING_PROFILES_ACTIVE: docker,blackhole
LOCAL_WRAPPING_KEY: "${LOCAL_WRAPPING_KEY:-oE3Pm+fr1I+YbX2ZxEe/n9INqJjy00KSl7oXXW4p5Xw=}"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4317"
JAVA_TOOL_OPTIONS: "${JAVA_TOOL_OPTIONS:-}"
OTEL_SERVICE_NAME: "direct-file-email"
volumes:
- type: tmpfs
target: /tmp
depends_on:
email-service-db:
condition: service_healthy
localstack:
condition: service_healthy
profiles:
- extras
state-api:
container_name: state-api
build:
context: ./direct-file/state-api
dockerfile: Dockerfile-local
additional_contexts:
factgraph-repo: ./direct-file/fact-graph-scala
boms: ./direct-file/boms
shared-libs: ./direct-file/libs
config: ./direct-file/config
args:
MAVEN_OPTS: "${MAVEN_OPTS:-}"
read_only: true
environment:
LOCAL_WRAPPING_KEY: "${LOCAL_WRAPPING_KEY:-oE3Pm+fr1I+YbX2ZxEe/n9INqJjy00KSl7oXXW4p5Xw=}"
SPRING_PROFILES_ACTIVE: development,docker
STATEAPI_PORT: "${STATEAPI_PORT:-8081}"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4317"
JAVA_TOOL_OPTIONS: "${JAVA_TOOL_OPTIONS:-}"
OTEL_SERVICE_NAME: "direct-file-state-api"
volumes:
- type: tmpfs
target: /tmp
depends_on:
state-api-db:
condition: service_healthy
localstack:
condition: service_healthy
ports:
- "${DF_LISTEN_ADDRESS:-127.0.0.1}:${STATEAPI_PORT:-8081}:${STATEAPI_PORT:-8080}"
localstack:
container_name: localstack
image: localstack/localstack
ports:
- "${DF_LISTEN_ADDRESS:-127.0.0.1}:4566:4566" # LocalStack Gateway
- "${DF_LISTEN_ADDRESS:-127.0.0.1}:4510-4559:4510-4559" # external services port range
environment:
- LOCALSTACK_HOST=localstack # where services are available from other containers
- SERVICES=s3,sqs,sqs-query,kms,sns,iam,lambda,logs
- DISABLE_EVENTS=1 # disable analytics
- LAMBDA_RUNTIME_ENVIRONMENT_TIMEOUT=60 # Set to 60 seconds for Lambda to cold start
volumes:
- "./docker/localstack/volume:/var/lib/localstack"
- ./docker/localstack/localstack-script.sh:/etc/localstack/init/ready.d/script.sh
- ./docker/localstack/policies:/etc/localstack/policies
- ./backend/docker/localstack/feature-flags.json:/etc/localstack/init/ready.d/feature-flags.json
# TODO: Remove when state-api sample testing data no longer needed?
- ./direct-file/state-api/docker/localstack/sample-tax-return.xml:/etc/localstack/init/ready.d/sample-tax-return.xml
- ./direct-file/state-api/docker/localstack/fakestate.cer:/etc/localstack/init/ready.d/fakestate.cer
- ./direct-file/state-api/docker/localstack/fakestate_expired.cer:/etc/localstack/init/ready.d/fakestate_expired.cer
# /TODO
- "/var/run/docker.sock:/var/run/docker.sock" # Docker socket mount for Lambda support
networks:
default:
aliases:
- s3.localhost.localstack.cloud
- direct-file-taxreturns.s3.localhost.localstack.cloud
- operations-jobs.s3.localhost.localstack.cloud
otel-collector:
container_name: direct-file-otel-collector
image: otel/opentelemetry-collector-contrib
command: ["--config=/etc/otel-collector-config.yaml"]
volumes:
- ./direct-file/monitoring/otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
- "${DF_LISTEN_ADDRESS:-127.0.0.1}:${DF_OTEL_PORT:-8888}:8888"
- "${DF_LISTEN_ADDRESS:-127.0.0.1}:${DF_OTEL_EXPORT_PORT:-8889}:8889"
profiles:
- monitoring
prometheus:
container_name: prometheus
restart: unless-stopped
image: quay.io/prometheus/prometheus
volumes:
- ./direct-file/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
- ./direct-file/monitoring/prometheus_data:/prometheus
ports:
- "${DF_LISTEN_ADDRESS:-127.0.0.1}:${DF_PROMETHEUS_PORT:-9090}:9090"
profiles:
- monitoring
grafana:
container_name: grafana
restart: unless-stopped
image: grafana/grafana
environment:
GF_INSTALL_PLUGINS: "grafana-clock-panel,grafana-simple-json-datasource"
volumes:
- ./direct-file/monitoring/grafana_data:/var/lib/grafana
- ./direct-file/monitoring/grafana/provisioning/:/etc/grafana/provisioning/
env_file:
- ./direct-file/monitoring/grafana/config.monitoring
ports:
- "${DF_LISTEN_ADDRESS:-127.0.0.1}:${DF_GRAFANA_PORT:-3030}:3000"
depends_on:
- prometheus
profiles:
- monitoring
wiremock:
restart: unless-stopped
image: "wiremock/wiremock:latest"
container_name: wiremock
ports:
- "${DF_LISTEN_ADDRESS:-127.0.0.1}:${DF_MOCKS_PORT:-5002}:8080"
volumes:
- ./utils/wiremock/extensions:/var/wiremock/extensions
- ./utils/wiremock/__files:/home/wiremock/__files
- ./utils/wiremock/mappings:/home/wiremock/mappings
entrypoint:
[
"/docker-entrypoint.sh",
"--global-response-templating",
"--disable-gzip",
"--verbose",
]
redis:
container_name: redis
image: redis:7.0
ports:
- "${DF_LISTEN_ADDRESS:-127.0.0.1}:6379:6379"