-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
290 lines (267 loc) · 6.73 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
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
## Define all volumes in docker-compose.override.yml so this file can be used in CI
services:
resources:
image: opg-digideps-resources
build:
context: .
dockerfile: ./client/docker/resources/Dockerfile
environment:
NODE_ENV: production
entrypoint: >
sh -c "npm run build"
load-balancer:
container_name: opg-digideps-loadbalancer
build:
context: local-resources/local-load-balancer
depends_on:
- frontend-webserver
- admin-webserver
ports:
- 443:443
frontend-webserver:
container_name: opg-digideps-frontend-webserver
build:
context: .
dockerfile: ./client/docker/web/Dockerfile
ports:
- 8070:80
depends_on:
- frontend-app
environment:
APP_HOST: frontend-app
APP_PORT: 9000
healthcheck:
test: /health-check.sh
interval: 30s
timeout: 30s
retries: 3
start_period: 60s
restart: always
frontend-app:
container_name: opg-digideps-frontend-app
build:
context: .
dockerfile: ./client/docker/app/Dockerfile
args:
REQUIRE_XDEBUG: ${REQUIRE_XDEBUG_CLIENT} # set REQUIRE_XDEBUG_CLIENT=1 in .env to install Xdebug
XDEBUG_IDEKEY_CLIENT: ${XDEBUG_IDEKEY_CLIENT}
depends_on:
- api-webserver
- redis-frontend
- htmltopdf
- localstack
- mock-notify-api
- pact-mock
- file-scanner-rest
environment:
APP_ENV: ${APP_ENV:-local}
APP_DEBUG: ${APP_DEBUG:-0}
env_file:
- ./client/app/frontend.env
restart: always
admin-webserver:
container_name: opg-digideps-admin-webserver
build:
context: .
dockerfile: ./client/docker/web/Dockerfile
ports:
- 8071:80
depends_on:
- admin-app
environment:
APP_HOST: admin-app
APP_PORT: 9000
healthcheck:
test: /health-check.sh
interval: 30s
timeout: 30s
retries: 3
start_period: 60s
restart: always
admin-app:
container_name: opg-digideps-admin-app
build:
context: .
dockerfile: ./client/docker/app/Dockerfile
args:
REQUIRE_XDEBUG: ${REQUIRE_XDEBUG_CLIENT} # set REQUIRE_XDEBUG_CLIENT=1 in .env to install Xdebug
XDEBUG_IDEKEY_CLIENT: ${XDEBUG_IDEKEY_CLIENT}
depends_on:
- api-webserver
- redis-frontend
- htmltopdf
- localstack
- mock-notify-api
environment:
APP_ENV: ${APP_ENV:-local}
APP_DEBUG: ${APP_DEBUG:-0}
env_file:
- ./client/app/frontend.env
- ./client/app/admin.env
restart: always
api-webserver:
container_name: opg-digideps-api-webserver
build:
context: .
dockerfile: ./api/docker/web/Dockerfile
ports:
- 8072:80
depends_on:
- api-app
environment:
APP_HOST: api-app
APP_PORT: 9000
restart: always
api-app:
container_name: opg-digideps-api-app
build:
context: .
dockerfile: ./api/docker/app/Dockerfile
args:
REQUIRE_XDEBUG: ${REQUIRE_XDEBUG_API} # set REQUIRE_XDEBUG_API=1 in .env to install Xdebug
XDEBUG_IDEKEY_API: ${XDEBUG_IDEKEY_API}
depends_on:
- postgres
- redis-api
- localstack
environment:
APP_ENV: ${APP_ENV:-local}
APP_DEBUG: ${APP_DEBUG:-0}
WORKSPACE: local
env_file:
- ./api/app/api.env
- ./api/app/tests/Behat/test.env
restart: always
htmltopdf:
build:
context: .
dockerfile: ./htmltopdf/Dockerfile
ports:
- 8080:8080
restart: always
postgres:
container_name: opg-digideps-postgres
image: postgres:13.14
ports:
- 5432:5432
env_file:
- ./api/app/postgres.env
restart: always
redis-frontend:
image: redis:6.2.12
restart: always
redis-api:
image: redis:6.2.12
restart: always
file-scanner-rest:
build:
context: .
dockerfile: ./file-scanner/Dockerfile
ports:
- 8085:8080
orchestration:
build: ./orchestration
depends_on:
- localstack
- postgres
env_file:
- orchestration/orchestration.env
aws:
image: infrastructureascode/aws-cli
environment:
- AWS_ACCESS_KEY_ID=foo
- AWS_SECRET_ACCESS_KEY=bar
working_dir: /app
depends_on:
- localstack
localstack:
build:
context: .
dockerfile: local-resources/localstack/Dockerfile
ports:
- "4566-4583:4566-4583"
environment:
- SERVICES=s3,ssm,logs,secretsmanager,lambda
- DATA_DIR=/tmp/localstack/data
- DEFAULT_REGION=eu-west-1
- USE_SINGLE_REGION=1
- DEBUG=1
- LAMBDA_EXECUTOR=docker
- LAMBDA_REMOVE_CONTAINERS="true"
- LAMBDA_FORWARD_URL=http://synchronisation:8080
wait-for-it:
build: ./wait-for-it
# pa11y:
# build:
# context: ./pa11y
# depends_on:
# - frontend
pact-mock:
image: pactfoundation/pact-cli:0.56.0.6
ports:
- 1234:80
command:
- mock-service
- -p
- "80"
- --host
- "0.0.0.0"
- --pact-dir
- /tmp/pacts
- --consumer
- Complete the deputy report
- --provider
- OPG Data
mock-sirius-integration:
image: muonsoft/openapi-mock:0.3.9
ports:
- 6060:8080
environment:
- OPENAPI_MOCK_SPECIFICATION_URL=https://raw.githubusercontent.com/ministryofjustice/opg-data-deputy-reporting/master/lambda_functions/v2/openapi/deputy-reporting-openapi.yml
mock-notify-api:
image: stoplight/prism:5.5.2
ports:
- 4010:4010
command:
- mock
- /tmp/govuk-notifications.yaml
- -h
- 0.0.0.0
- --dynamic
synchronisation:
container_name: opg-synchronisation-lambda
build:
context: ./lambdas/functions/synchronisation
ports:
- 2080:8080
environment:
AWS_REGION: eu-west-1
AWS_ACCESS_KEY_ID: localstack
AWS_SECRET_ACCESS_KEY: localstack
DIGIDEPS_SYNC_ENDPOINT: https://frontend
SECRETS_PREFIX: local
LOCALSTACK_ENDPOINT: http://localstack:4566
entrypoint: /aws-lambda/aws-lambda-rie /var/task/main
composer:
image: composer:2.5.8
command: ["install"]
custom-sql-query:
image: custom-sql-query:latest
build:
context: lambdas/functions/custom_sql_query
dockerfile: Dockerfile
ports:
- 9070:8080
depends_on:
- localstack
- postgres
volumes:
- ./lambdas/.aws-lambda-rie:/aws-lambda
- ./lambdas/functions/custom_sql_query/app:/function/app
environment:
ENVIRONMENT: local
DATABASE_HOSTNAME: postgres
DATABASE_NAME: api
DATABASE_USERNAME: custom_sql_user
DATABASE_PORT: 5432
entrypoint: /aws-lambda/aws-lambda-rie /usr/local/bin/python -m awslambdaric app.sql_query.lambda_handler