-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompose.yml
391 lines (376 loc) · 14.5 KB
/
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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
services:
gateway:
container_name: co-cdp-gateway
image: nginx:1.27
healthcheck:
test: ["CMD-SHELL", "curl --fail --silent --write-out '{\"status\":%{http_code}}' --output /dev/null http://127.0.0.1:8080/health"]
start_period: 10s
interval: 10s
timeout: 10s
retries: 3
depends_on:
- organisation-app
- authority
- tenant
- organisation
- person
- forms
- data-sharing
- entity-verification
- av-scanner
- clamav-rest
volumes:
- './docker/gateway/nginx.conf:/etc/nginx/nginx.conf:ro'
- './docker/gateway/templates:/etc/nginx/templates:ro'
environment:
CDP_ORGANISATION_APP_HOST: 'http://organisation-app:8080'
CDP_AUTHORITY_HOST: 'http://authority:8080'
CDP_TENANT_HOST: 'http://tenant:8080'
CDP_ORGANISATION_HOST: 'http://organisation:8080'
CDP_PERSON_HOST: 'http://person:8080'
CDP_FORMS_HOST: 'http://forms:8080'
CDP_DATA_SHARING_HOST: 'http://data-sharing:8080'
CDP_ENTITY_VERIFICATION_HOST: 'http://entity-verification:8080'
db:
container_name: co-cdp-db
image: postgres:16.3
expose:
- '5432'
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U$${POSTGRES_USER:-} -d $${POSTGRES_DB:-}" ]
interval: 3s
timeout: 5s
retries: 5
environment:
POSTGRES_DB: cdp
POSTGRES_USER: cdp_user
POSTGRES_PASSWORD: cdp123
redis:
container_name: co-cdp-redis
image: redis:7.4.1
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 1s
timeout: 3s
retries: 5
localstack:
container_name: co-cdp-localstack
image: localstack/localstack:3.5
healthcheck:
test: ["CMD", "/etc/localstack/healthcheck.sh"]
interval: 10s
timeout: 5s
retries: 5
environment:
# LocalStack configuration: https://docs.localstack.cloud/references/configuration/
SERVICES: sqs,s3,logs,ssm
DEBUG: 0
SQS_QUEUES: entity-verification.fifo,organisation.fifo,av-scanner.fifo
S3_BUCKETS: cdp-staging-bucket.s3,cdp-permanent-bucket.s3
LOG_GROUP_NAME: localstack
LOG_STREAM_NAME: serilog
volumes:
- './docker/localstack/ready.d:/etc/localstack/init/ready.d:ro'
- './docker/localstack/healthcheck.sh:/etc/localstack/healthcheck.sh:ro'
organisation-information-migrations:
container_name: co-cdp-organisation-information-migrations
restart: no
build:
context: .
dockerfile: Dockerfile
target: migrations-organisation-information
image: 'cabinetoffice/cdp-organisation-information-migrations:${IMAGE_VERSION:-latest}'
depends_on:
db:
condition: service_healthy
environment:
ASPNETCORE_ENVIRONMENT: Production
OrganisationInformationDatabase__Server: 'db'
OrganisationInformationDatabase__Host: 'db'
OrganisationInformationDatabase__Database: 'cdp'
OrganisationInformationDatabase__Username: 'cdp_user'
OrganisationInformationDatabase__Password: 'cdp123'
Organisation__Authority: '${Organisation__Authority:-http://gateway:${CDP_AUTHORITY_PORT:-8092}}'
entity-verification-migrations:
container_name: co-cdp-entity-verification-migrations
restart: no
build:
context: .
dockerfile: Dockerfile
target: migrations-entity-verification
image: 'cabinetoffice/cdp-entity-verification-migrations:${IMAGE_VERSION:-latest}'
depends_on:
db:
condition: service_healthy
environment:
ASPNETCORE_ENVIRONMENT: Production
EntityVerificationDatabase__Host: 'db'
EntityVerificationDatabase__Server: 'db'
EntityVerificationDatabase__Database: 'cdp'
EntityVerificationDatabase__Username: 'cdp_user'
EntityVerificationDatabase__Password: 'cdp123'
Organisation__Authority: '${Organisation__Authority:-http://gateway:${CDP_AUTHORITY_PORT:-8092}}'
organisation-app:
container_name: co-cdp-organisation-app
build:
context: .
dockerfile: Dockerfile
target: final-organisation-app
image: 'cabinetoffice/cdp-organisation-app:${IMAGE_VERSION:-latest}'
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl --fail --silent --write-out '{\"status\":%{http_code}}' --output /dev/null http://127.0.0.1:8080/health"]
start_period: 10s
interval: 10s
timeout: 10s
retries: 3
environment:
ASPNETCORE_ENVIRONMENT: Production
Aws__Buckets__PermanentBucket: cdp-permanent-bucket.s3
Aws__Buckets__StagingBucket: cdp-staging-bucket.s3
Aws__Credentials__AccessKeyId: test
Aws__Credentials__SecretAccessKey: test
Aws__ServiceURL: "http://localstack:4566"
Aws__ElastiCache__Hostname: "redis"
Aws__SqsPublisher__QueueUrl: "http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/av-scanner.fifo"
FormsService: '${FormsService:-http://gateway:${CDP_FORMS_PORT:-8086}}'
OrganisationService: '${OrganisationService:-http://gateway:${CDP_ORGANISATION_PORT:-8082}}'
Organisation__Authority: '${Organisation__Authority:-http://gateway:${CDP_AUTHORITY_PORT:-8092}}'
PersonService: '${PersonService:-http://gateway:${CDP_PERSON_PORT:-8084}}'
TenantService: '${TenantService:-http://gateway:${CDP_TENANT_PORT:-8080}}'
DataSharingService: '${DataSharingService:-http://gateway:${CDP_DATA_SHARING_PORT:-8088}}'
EntityVerificationService: '${EntityVerificationService:-http://gateway:${CDP_ENTITY_VERIFICATION_PORT:-8094}}'
CompaniesHouse__Url: ""
CompaniesHouse__User: ""
CompaniesHouse__Password: ""
CharityCommission__Url: ""
CharityCommission__SubscriptionKey: ""
authority:
container_name: co-cdp-authority
build:
context: .
dockerfile: Dockerfile
target: final-authority
image: 'cabinetoffice/cdp-authority:${IMAGE_VERSION:-latest}'
healthcheck:
test: ["CMD-SHELL", "curl --fail --silent --write-out '{\"status\":%{http_code}}' --output /dev/null http://127.0.0.1:8080/health"]
start_period: 10s
interval: 10s
timeout: 10s
retries: 3
depends_on:
- db
environment:
ASPNETCORE_ENVIRONMENT: Production
OrganisationInformationDatabase__Server: 'db'
OrganisationInformationDatabase__Database: 'cdp'
OrganisationInformationDatabase__Username: 'cdp_user'
OrganisationInformationDatabase__Password: 'cdp123'
Issuer: 'http://gateway:${CDP_AUTHORITY_PORT:-8092}'
tenant:
container_name: co-cdp-tenant
build:
context: .
dockerfile: Dockerfile
target: final-tenant
image: 'cabinetoffice/cdp-tenant:${IMAGE_VERSION:-latest}'
healthcheck:
test: ["CMD-SHELL", "curl --fail --silent --write-out '{\"status\":%{http_code}}' --output /dev/null http://127.0.0.1:8080/health"]
start_period: 10s
interval: 10s
timeout: 10s
retries: 3
depends_on:
- db
environment:
ASPNETCORE_ENVIRONMENT: Production
OrganisationInformationDatabase__Server: 'db'
OrganisationInformationDatabase__Database: 'cdp'
OrganisationInformationDatabase__Username: 'cdp_user'
OrganisationInformationDatabase__Password: 'cdp123'
Organisation__Authority: '${Organisation__Authority:-http://gateway:${CDP_AUTHORITY_PORT:-8092}}'
Aws__Credentials__AccessKeyId: test
Aws__Credentials__SecretAccessKey: test
Aws__ServiceURL: "http://localstack:4566"
organisation:
container_name: co-cdp-organisation
build:
context: .
dockerfile: Dockerfile
target: final-organisation
image: 'cabinetoffice/cdp-organisation:${IMAGE_VERSION:-latest}'
healthcheck:
test: ["CMD-SHELL", "curl --fail --silent --write-out '{\"status\":%{http_code}}' --output /dev/null http://127.0.0.1:8080/health"]
start_period: 10s
interval: 10s
timeout: 10s
retries: 3
depends_on:
db:
condition: "service_healthy"
localstack:
condition: "service_healthy"
environment:
ASPNETCORE_ENVIRONMENT: Production
Aws__Credentials__AccessKeyId: test
Aws__Credentials__SecretAccessKey: test
Aws__ServiceURL: "http://localstack:4566"
Aws__SqsDispatcher__QueueUrl: "http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/entity-verification.fifo"
Aws__SqsPublisher__QueueUrl: "http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/organisation.fifo"
OrganisationInformationDatabase__Server: 'db'
OrganisationInformationDatabase__Database: 'cdp'
OrganisationInformationDatabase__Username: 'cdp_user'
OrganisationInformationDatabase__Password: 'cdp123'
Organisation__Authority: '${Organisation__Authority:-http://gateway:${CDP_AUTHORITY_PORT:-8092}}'
person:
container_name: co-cdp-person
build:
context: .
dockerfile: Dockerfile
target: final-person
image: 'cabinetoffice/cdp-person:${IMAGE_VERSION:-latest}'
healthcheck:
test: ["CMD-SHELL", "curl --fail --silent --write-out '{\"status\":%{http_code}}' --output /dev/null http://127.0.0.1:8080/health"]
start_period: 10s
interval: 10s
timeout: 10s
retries: 3
depends_on:
- db
environment:
ASPNETCORE_ENVIRONMENT: Production
OrganisationInformationDatabase__Server: 'db'
OrganisationInformationDatabase__Database: 'cdp'
OrganisationInformationDatabase__Username: 'cdp_user'
OrganisationInformationDatabase__Password: 'cdp123'
Organisation__Authority: '${Organisation__Authority:-http://gateway:${CDP_AUTHORITY_PORT:-8092}}'
forms:
container_name: co-cdp-forms
build:
context: .
dockerfile: Dockerfile
target: final-forms
image: 'cabinetoffice/cdp-forms:${IMAGE_VERSION:-latest}'
healthcheck:
test: ["CMD-SHELL", "curl --fail --silent --write-out '{\"status\":%{http_code}}' --output /dev/null http://127.0.0.1:8080/health"]
start_period: 10s
interval: 10s
timeout: 10s
retries: 3
depends_on:
- db
environment:
ASPNETCORE_ENVIRONMENT: Production
Aws__Buckets__PermanentBucket: cdp-permanent-bucket.s3
Aws__Buckets__StagingBucket: cdp-staging-bucket.s3
Aws__Credentials__AccessKeyId: test
Aws__Credentials__SecretAccessKey: test
Aws__ServiceURL: "http://localstack:4566"
OrganisationInformationDatabase__Server: 'db'
OrganisationInformationDatabase__Database: 'cdp'
OrganisationInformationDatabase__Username: 'cdp_user'
OrganisationInformationDatabase__Password: 'cdp123'
Organisation__Authority: '${Organisation__Authority:-http://gateway:${CDP_AUTHORITY_PORT:-8092}}'
data-sharing:
container_name: co-cdp-data-sharing
build:
context: .
dockerfile: Dockerfile
target: final-data-sharing
image: 'cabinetoffice/cdp-data-sharing:${IMAGE_VERSION:-latest}'
healthcheck:
test: ["CMD-SHELL", "curl --fail --silent --write-out '{\"status\":%{http_code}}' --output /dev/null http://127.0.0.1:8080/health"]
start_period: 10s
interval: 10s
timeout: 10s
retries: 3
depends_on:
- db
environment:
ASPNETCORE_ENVIRONMENT: Production
Aws__Buckets__PermanentBucket: cdp-permanent-bucket.s3
Aws__Buckets__StagingBucket: cdp-staging-bucket.s3
Aws__Credentials__AccessKeyId: test
Aws__Credentials__SecretAccessKey: test
Aws__ServiceURL: "http://localstack:4566"
OrganisationInformationDatabase__Server: 'db'
OrganisationInformationDatabase__Database: 'cdp'
OrganisationInformationDatabase__Username: 'cdp_user'
OrganisationInformationDatabase__Password: 'cdp123'
Organisation__Authority: '${Organisation__Authority:-http://gateway:${CDP_AUTHORITY_PORT:-8092}}'
entity-verification:
container_name: co-cdp-entity-verification
build:
context: .
dockerfile: Dockerfile
target: final-entity-verification
image: 'cabinetoffice/cdp-entity-verification:${IMAGE_VERSION:-latest}'
healthcheck:
test: ["CMD-SHELL", "curl --fail --silent --write-out '{\"status\":%{http_code}}' --output /dev/null http://127.0.0.1:8080/health"]
start_period: 10s
interval: 10s
timeout: 10s
retries: 3
depends_on:
db:
condition: "service_healthy"
localstack:
condition: "service_healthy"
environment:
ASPNETCORE_ENVIRONMENT: Production
Aws__Credentials__AccessKeyId: test
Aws__Credentials__SecretAccessKey: test
Aws__ServiceURL: "http://localstack:4566"
Aws__SqsDispatcher__QueueUrl: "http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/organisation.fifo"
Aws__SqsPublisher__QueueUrl: "http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/entity-verification.fifo"
EntityVerificationDatabase__Server: 'db'
EntityVerificationDatabase__Database: 'cdp'
EntityVerificationDatabase__Username: 'cdp_user'
EntityVerificationDatabase__Password: 'cdp123'
Organisation__Authority: '${Organisation__Authority:-http://gateway:${CDP_AUTHORITY_PORT:-8092}}'
clamav-rest:
mem_reservation: "2G"
mem_limit: "3G"
image: ajilaag/clamav-rest
read_only: true
user: 100:101
# TODO: curl doesn't exist in this image, so healthcheck is failing
# healthcheck:
# test: ["CMD-SHELL", "curl --fail --silent --write-out '{\"status\":%{http_code}}' --output /dev/null http://127.0.0.1:8080/health"]
# start_period: 10s
# interval: 10s
# timeout: 10s
# retries: 3
volumes:
- clamav:/clamav:rw
- run-clamav:/run/clamav:rw
- var-log-clamav:/var/log/clamav:rw
av-scanner:
container_name: co-cdp-av-scanner-app
build:
context: .
dockerfile: Dockerfile
target: final-antivirus-app
image: 'cabinetoffice/cdp-av-scanner-app:${IMAGE_VERSION:-latest}'
healthcheck:
test: ["CMD-SHELL", "curl --fail --silent --write-out '{\"status\":%{http_code}}' --output /dev/null http://127.0.0.1:8080/health"]
start_period: 10s
interval: 10s
timeout: 10s
retries: 3
environment:
ASPNETCORE_ENVIRONMENT: Production
ClamAvScanUrl: 'http://clamav-rest:9000/scan'
Aws__Credentials__AccessKeyId: test
Aws__Credentials__SecretAccessKey: test
Aws__ServiceURL: "http://localstack:4566"
Aws__SqsPublisher__QueueUrl: "http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/av-scanner.fifo"
depends_on:
localstack:
condition: "service_healthy"
volumes:
clamav:
run-clamav:
var-log-clamav: