-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
321 lines (309 loc) · 12.7 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
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
name: funding-service
services:
fab:
build:
context: ./apps/funding-service-design-fund-application-builder
dockerfile: Dockerfile
args:
- USE_DEV_REQUIREMENTS=true
command: [ "sh", "-c", "python -m flask db upgrade && python -m build && python -m debugpy --listen 0.0.0.0:5678 -m flask run --no-debugger --host 0.0.0.0 --port 8080 --cert=/app-certs/cert.pem --key=/app-certs/key.pem" ]
env_file:
- .env
environment:
- FORM_RUNNER_INTERNAL_HOST=https://form-runner.levellingup.gov.localhost:3009
- FORM_RUNNER_EXTERNAL_HOST=https://form-runner.levellingup.gov.localhost:3009
- DATABASE_URL=postgresql://postgres:password@database:5432/fab_store # pragma: allowlist secret
- FLASK_DEBUG=1
- FLASK_ENV=development
- SECRET_KEY=local
- AUTHENTICATOR_HOST=https://authenticator.levellingup.gov.localhost:4004
- RSA256_PUBLIC_KEY_BASE64="LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlHZU1BMEdDU3FHU0liM0RRRUJBUVVBQTRHTUFEQ0JpQUtCZ0hHYnRGMXlWR1crckNBRk9JZGFrVVZ3Q2Z1dgp4SEUzOGxFL2kwS1dwTXdkU0haRkZMWW5IakJWT09oMTVFaWl6WXphNEZUSlRNdkwyRTRRckxwcVlqNktFNnR2CkhyaHlQL041ZnlwU3p0OHZDajlzcFo4KzBrRnVjVzl6eU1rUHVEaXNZdG1rV0dkeEJta2QzZ3RZcDNtT0k1M1YKVkRnS2J0b0lGVTNzSWs1TkFnTUJBQUU9Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQ=="
ports:
- 3011:8080
- 5690:5678
depends_on:
database:
condition: service_healthy
volumes:
- './apps/funding-service-design-fund-application-builder:/app'
- './certs:/app-certs'
- '/app/.venv' # Don't overwrite this directory with local .venv because uv links won't translate in the container
profiles: [ pre ]
networks:
default:
aliases:
- fund-application-builder.levellingup.gov.localhost
pre-award:
build:
context: ./apps/funding-service-pre-award
stdin_open: true
tty: true
command: >
bash -c "
cp /app-certs/rootCA.pem /usr/local/share/ca-certificates/rootCA.crt && \
update-ca-certificates && \
flask -A app:create_app db upgrade && \
python build.py && \
python -m fund_store.scripts.load_all_fund_rounds && \
python -m fund_store.scripts.fund_round_loaders.load_fund_round_from_fab --seed_all_funds True && \
python -m invoke assessment.seed-assessment-store-db && \
python -m invoke account.seed-local-account-store && \
python -m debugpy --listen 0.0.0.0:5678 -m flask -A app:create_app run --host 0.0.0.0 --port 4004 --cert=/app-certs/cert.pem --key=/app-certs/key.pem
"
env_file:
- .env
- .awslocal.env
environment:
- FLASK_ENV=development
- GOV_NOTIFY_API_KEY=${GOV_NOTIFY_API_KEY:?err}
- DATABASE_URL=postgresql://postgres:password@database:5432/pre_award_stores
- FUND_STORE_API_HOST=https://api.levellingup.gov.localhost:4004/fund
- ACCOUNT_STORE_API_HOST=https://api.levellingup.gov.localhost:4004/account
- APPLICATION_STORE_API_HOST=https://api.levellingup.gov.localhost:4004/application
- REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
- USE_LOCAL_DATA=False
- FORMS_SERVICE_PUBLIC_HOST=https://form-runner.levellingup.gov.localhost:3009
- FORMS_SERVICE_PRIVATE_HOST=https://form-runner.levellingup.gov.localhost:3009
- AUTHENTICATOR_HOST=https://authenticator.levellingup.gov.localhost:4004
- APPLY_HOST=frontend.levellingup.gov.localhost:3008
- ASSESS_HOST=assessment.levellingup.gov.localhost:3010
- API_HOST=api.levellingup.gov.localhost:4004
- AUTH_HOST=authenticator.levellingup.gov.localhost:4004
- FLASK_DEBUG=1
- REDIS_INSTANCE_URI=redis://redis-data:6379
- SECRET_KEY=dc_key
- ASSESSMENT_STORE_API_HOST=https://api.levellingup.gov.localhost:4004/assessment
- APPLICANT_FRONTEND_HOST=https://frontend.levellingup.gov.localhost:3008
- ASSESSMENT_FRONTEND_HOST=https://assessment.levellingup.gov.localhost:3010
- POST_AWARD_FRONTEND_HOST=https://find-monitoring-data.levellingup.gov.localhost:4001
- POST_AWARD_SUBMIT_HOST=https://submit-monitoring-data.levellingup.gov.localhost:4001
- FUND_APPLICATION_BUILDER_HOST=https://fund-application-builder.levellingup.gov.localhost:3011
- FORM_DESIGNER_HOST=https://form-designer.levellingup.gov.localhost
- COOKIE_DOMAIN=.levellingup.gov.localhost
ports:
- 4004:4004
- 3008:4004
- 3010:4004
- 5692:5678
depends_on:
database:
condition: service_healthy
localstack:
condition: service_started
redis-data:
condition: service_started
volumes:
- './apps/funding-service-pre-award:/app'
- './certs:/app-certs'
- '/app/.venv' # Don't overwrite this directory with local .venv because uv links won't translate in the container
networks:
default:
aliases:
- api.levellingup.gov.localhost
- frontend.levellingup.gov.localhost
- assessment.levellingup.gov.localhost
- authenticator.levellingup.gov.localhost
profiles: [ pre, post ]
form-designer:
depends_on:
- form-runner
build:
context: ./apps/digital-form-builder-adapter
dockerfile: ./designer/Dockerfile
command: yarn designer production
ports:
- 3000:3000
volumes:
- './certs:/app-certs'
env_file:
- .env # For the AZURE_AD_* variables
- .awslocal.env
environment:
- NODE_EXTRA_CA_CERTS=/app-certs/rootCA.pem
- SSL_KEY=/app-certs/key.pem
- SSL_CERT=/app-certs/cert.pem
- LOG_LEVEL=debug
- AUTH_ENABLED=true
- AUTH_COOKIE_NAME=fsd_user_token
- SSO_LOGIN_URL=/sso/login?return_app=form-designer
- SSO_LOGOUT_URL=/sessions/sign-out
- AUTH_SERVICE_URL=https://authenticator.levellingup.gov.localhost:4004
- NODE_ENV=production
- PREVIEW_URL=https://form-runner.levellingup.gov.localhost:3009
- PUBLISH_URL=https://form-runner.levellingup.gov.localhost:3009
- RSA256_PUBLIC_KEY_BASE64="LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlHZU1BMEdDU3FHU0liM0RRRUJBUVVBQTRHTUFEQ0JpQUtCZ0hHYnRGMXlWR1crckNBRk9JZGFrVVZ3Q2Z1dgp4SEUzOGxFL2kwS1dwTXdkU0haRkZMWW5IakJWT09oMTVFaWl6WXphNEZUSlRNdkwyRTRRckxwcVlqNktFNnR2CkhyaHlQL041ZnlwU3p0OHZDajlzcFo4KzBrRnVjVzl6eU1rUHVEaXNZdG1rV0dkeEJta2QzZ3RZcDNtT0k1M1YKVkRnS2J0b0lGVTNzSWs1TkFnTUJBQUU9Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQ=="
- 'NODE_CONFIG={"safelist": ["api.levellingup.gov.localhost"]}'
networks:
default:
aliases:
- form-designer.levellingup.gov.localhost
profiles: [ pre ]
form-runner:
depends_on:
- redis-data
- localstack
build:
context: ./apps/digital-form-builder-adapter
dockerfile: ./runner/Dockerfile
command: yarn runner production
ports:
- 3009:3009
- 9228:9228
volumes:
- './certs:/app-certs'
env_file:
- .env # For the AZURE_AD_* variables
- .awslocal.env
environment:
- NODE_EXTRA_CA_CERTS=/app-certs/rootCA.pem
- SSL_KEY=/app-certs/key.pem
- SSL_CERT=/app-certs/cert.pem
- LOG_LEVEL=debug
- JWT_AUTH_ENABLED=true
- JWT_AUTH_COOKIE_NAME=fsd_user_token
- JWT_REDIRECT_TO_AUTHENTICATION_URL=https://authenticator.levellingup.gov.localhost:4004/sessions/sign-out
- RSA256_PUBLIC_KEY_BASE64="LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlHZU1BMEdDU3FHU0liM0RRRUJBUVVBQTRHTUFEQ0JpQUtCZ0hHYnRGMXlWR1crckNBRk9JZGFrVVZ3Q2Z1dgp4SEUzOGxFL2kwS1dwTXdkU0haRkZMWW5IakJWT09oMTVFaWl6WXphNEZUSlRNdkwyRTRRckxwcVlqNktFNnR2CkhyaHlQL041ZnlwU3p0OHZDajlzcFo4KzBrRnVjVzl6eU1rUHVEaXNZdG1rV0dkeEJta2QzZ3RZcDNtT0k1M1YKVkRnS2J0b0lGVTNzSWs1TkFnTUJBQUU9Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQ=="
- 'NODE_CONFIG={"safelist": ["api.levellingup.gov.localhost"]}'
- CONTACT_US_URL=https://frontend.levellingup.gov.localhost:3008/contact_us
- FEEDBACK_LINK=https://frontend.levellingup.gov.localhost:3008/feedback
- COOKIE_POLICY_URL=https://frontend.levellingup.gov.localhost:3008/cookie_policy
- ACCESSIBILITY_STATEMENT_URL=https://frontend.levellingup.gov.localhost:3008/accessibility_statement
- SERVICE_START_PAGE=https://frontend.levellingup.gov.localhost:3008/account
- MULTIFUND_URL=https://frontend.levellingup.gov.localhost:3008/account
- LOGOUT_URL=https://authenticator.levellingup.gov.localhost:4004/sessions/sign-out
- PRIVACY_POLICY_URL=https://frontend.levellingup.gov.localhost:3008/privacy
- ELIGIBILITY_RESULT_URL=https://frontend.levellingup.gov.localhost:3008/eligibility-result
- SINGLE_REDIS=true
- FORM_RUNNER_ADAPTER_REDIS_INSTANCE_URI=redis://redis-data:6379
networks:
default:
aliases:
- form-runner.levellingup.gov.localhost
profiles: [ pre ]
notification:
build:
context: ./apps/funding-service-design-notification
volumes:
- './apps/funding-service-design-notification:/app'
- '/app/.venv' # Don't overwrite this directory with local .venv because uv links won't translate in the container
command: [ "sh", "-c", "python -m debugpy --listen 0.0.0.0:5678 -m wsgi" ]
ports:
- 3006:8080
- 5686:5678
depends_on:
- localstack
env_file:
- .env
- .awslocal.env
environment:
- GOV_NOTIFY_API_KEY=${GOV_NOTIFY_API_KEY:?err}
- FLASK_DEBUG=1
- FLASK_ENV=development
- AWS_MSG_BUCKET_NAME=fsd-notification-bucket
profiles: [ pre ]
data-store:
# http://github.com/communitiesuk/funding-service-design-post-award-data-store
build:
context: ./apps/funding-service-design-post-award-data-store
command: >
bash -c "
flask db upgrade &&
flask db-data seed-ref &&
flask db-data seed-sample-data &&
python -m debugpy --listen 0.0.0.0:5678 -m flask run -p 4001 -h 0.0.0.0 --cert=/app-certs/cert.pem --key=/app-certs/key.pem
"
volumes:
- './apps/funding-service-design-post-award-data-store:/app'
- './certs:/app-certs'
- '/app/.venv' # Don't overwrite this directory with local .venv because uv links won't translate in the container
stdin_open: true
tty: true
ports:
- 4001:4001
- 5687:5678
env_file:
- .env
- .awslocal.env
environment:
- FLASK_ENV=development
- DATABASE_URL=postgresql://postgres:password@database:5432/data_store
- FIND_SERVICE_BASE_URL=https://find-monitoring-data.levellingup.gov.localhost:4001
- REDIS_URL=redis://redis-data:6379/1
- AUTHENTICATOR_HOST=https://authenticator.levellingup.gov.localhost:4004
restart: unless-stopped
depends_on:
database:
condition: service_healthy
networks:
default:
aliases:
- find-monitoring-data.levellingup.gov.localhost
- submit-monitoring-data.levellingup.gov.localhost
profiles: [ post ]
data-store-celery:
build:
context: ./apps/funding-service-design-post-award-data-store
args:
REQUIREMENTS: requirements-dev.txt
command: >
bash -c " if [ \"$CELERY_AUTO_REFRESH\" = \"true\" ]; then
watchfiles 'celery -A app.celery_app worker --loglevel INFO' --filter python;
else
celery -A app.celery_app worker --loglevel INFO;
fi "
volumes:
- './apps/funding-service-design-post-award-data-store:/app'
- '/app/.venv' # Don't overwrite this directory with local .venv because uv links won't translate in the container
depends_on:
redis-data:
condition: service_started
database:
condition: service_healthy
env_file:
- .env
- .awslocal.env
environment:
- FLASK_ENV=development
- DATABASE_URL=postgresql://postgres:password@database:5432/data_store
- FIND_SERVICE_BASE_URL=https://find-monitoring-data.levellingup.gov.localhost:4001
- REDIS_URL=redis://redis-data:6379/1
stdin_open: true
tty: true
restart: unless-stopped
profiles: [ post ]
redis-data:
image: redis
ports:
- 6379:6379
database:
image: postgres
volumes:
- ./docker-postgresql-multiple-databases:/docker-entrypoint-initdb.d
restart: always
environment:
- POSTGRES_PASSWORD=password
- POSTGRES_MULTIPLE_DATABASES=assessment_store,account_store,data_store,data_store_test,fab_store,fab_store_test,pre_award_stores,pre_award_stores_test
ports:
- 5432:5432
healthcheck:
test: pg_isready -U postgres
interval: 10s
timeout: 5s
retries: 5
localstack:
image: localstack/localstack:3.7.2
env_file: .awslocal.env
environment:
- SERVICES=s3,sqs
- PERSISTENCE=1
- LS_LOG=warn
ports:
- 4566:4566 # LocalStack endpoint
- 4510-4559:4510-4559 # external services port range
volumes:
- ./docker-localstack:/etc/localstack/init/ready.d
- localstack:/var/lib/localstack
volumes:
localstack: null
networks:
default: