Skip to content

Commit 41c8695

Browse files
committed
🐳 [#458] Add setup configuration step to docker compose
1 parent dc6668b commit 41c8695

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ COPY ./backend/bin/celery_worker.sh /celery_worker.sh
7171
COPY ./backend/bin/celery_beat.sh /celery_beat.sh
7272
COPY ./backend/bin/celery_flower.sh /celery_flower.sh
7373
COPY ./backend/bin/check_celery_worker_liveness.py /check_celery_worker_liveness.py
74+
COPY ./backend/bin/setup_configuration.sh /setup_configuration.sh
7475
COPY ./frontend/scripts/replace-envvars.sh /replace-envvars.sh
7576

7677
RUN mkdir -p /app/log /app/media /app/src/openarchiefbeheer/static/

backend/bin/setup_configuration.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
3+
until pg_isready; do
4+
>&2 echo "Waiting for database connection..."
5+
sleep 1
6+
done
7+
8+
until python src/manage.py migrate --check; do
9+
>&2 echo "Waiting for migrations to be done..."
10+
sleep 1
11+
done
12+
13+
# Run setup configuration
14+
python src/manage.py setup_configuration --yaml-file setup_configuration/data.yaml

backend/src/openarchiefbeheer/fixtures/setup_configuration.yaml backend/docker-services/setup-configuration/data.yaml

+1-6
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,38 @@ zgw_consumers:
33
services:
44
- identifier: zaken-test
55
label: Open Zaak - Zaken API
6-
oas: http://localhost:8003/zaken/api/v1/schema/openapi.yaml
76
api_root: http://localhost:8003/zaken/api/v1/
87
api_type: zrc
98
auth_type: zgw
109
client_id: test-vcr
1110
secret: test-vcr
1211
- identifier: documenten-test
1312
label: Open Zaak - Documenten API
14-
oas: http://localhost:8003/documenten/api/v1/schema/openapi.yaml
1513
api_root: http://localhost:8003/documenten/api/v1/
1614
api_type: drc
1715
auth_type: zgw
1816
client_id: test-vcr
1917
secret: test-vcr
2018
- identifier: catalogi-test
2119
label: Open Zaak - Catalogi API
22-
oas: http://localhost:8003/catalogi/api/v1/schema/openapi.yaml
2320
api_root: http://localhost:8003/catalogi/api/v1/
2421
api_type: ztc
2522
auth_type: zgw
2623
client_id: test-vcr
2724
secret: test-vcr
2825
- identifier: besluiten-test
2926
label: Open Zaak - Besluiten API
30-
oas: http://localhost:8003/besluiten/api/v1/schema/openapi.yaml
3127
api_root: http://localhost:8003/besluiten/api/v1/
3228
api_type: brc
3329
auth_type: zgw
3430
client_id: test-vcr
3531
secret: test-vcr
3632
- identifier: selectielijst
3733
label: Open Zaak (public) - Selectielijst API
38-
oas: https://selectielijst.openzaak.nl/api/v1/schema/openapi.yaml
3934
api_root: https://selectielijst.openzaak.nl/api/v1/
4035
api_type: orc
4136
auth_type: no_auth
4237

4338
api_configuration_enabled: True
4439
api_configuration:
45-
selectielijst_service_identifier: selectielijst
40+
selectielijst_service_identifier: selectielijst

docker-compose.yml

+13
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@ services:
5858
networks:
5959
- open-archiefbeheer-dev
6060

61+
web-init:
62+
build: .
63+
environment: *web_env
64+
command: /setup_configuration.sh
65+
volumes:
66+
- ./backend/docker-services/setup-configuration:/app/setup_configuration
67+
depends_on:
68+
- db
69+
- redis
70+
- web
71+
networks:
72+
- open-archiefbeheer-dev
73+
6174
celery:
6275
build: .
6376
command: /celery_worker.sh

0 commit comments

Comments
 (0)