Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 178 additions & 0 deletions backend/docker-services/opennotificaties/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
#
# DISCLAIMER: THIS IS FOR DEVELOPMENT PURPOSES ONLY AND NOT SUITABLE FOR PRODUCTION.
#
# You can use this docker-compose to spin up a local stack for demo/try-out
# purposes, or to get some insight in the various components involved (e.g. to build
# your Helm charts from). Note that various environment variables are UNSAFE and merely
# specified so that you can get up and running with the least amount of friction.

services:
notificaties-db:
image: postgis/postgis:17-3.5
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- ./postgres.entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro
- notificaties-db:/var/lib/postgresql/data
command: postgres -c max_connections=300 -c log_min_messages=LOG
healthcheck:
test: ["CMD-SHELL", "pg_isready -U opennotificaties -d opennotificaties"]
interval: 10s
timeout: 5s
retries: 5
ports:
- "11234:5432"
networks:
- open-notificaties-dev

notificaties-redis:
image: redis:8
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 1s
retries: 3
networks:
- open-notificaties-dev

notificaties-web:
image: openzaak/open-notificaties:${OPENNOTIFICATIES_VERSION:-1.16.2}
environment: &app-env
DJANGO_SETTINGS_MODULE: nrc.conf.docker
SECRET_KEY: ${SECRET_KEY:-\(,gc7VE(#CO<zCR3e(lRtOsw5q+U2DpG5o\X#P4PVRm*=u|E%}
IS_HTTPS: no
ALLOWED_HOSTS: '*'
CACHE_DEFAULT: notificaties-redis:6379/0
CACHE_AXES: notificaties-redis:6379/0
DB_NAME: opennotificaties
DB_USER: opennotificaties
DB_HOST: notificaties-db
OPENNOTIFICATIES_SUPERUSER_USERNAME: admin
OPENNOTIFICATIES_SUPERUSER_EMAIL: admin@localhost
DJANGO_SUPERUSER_PASSWORD: admin
# Celery
CELERY_BROKER_URL: redis://notificaties-redis:6379/0
CELERY_WORKER_NAME: celery@docker
CELERY_RESULT_EXPIRES: 3600
CELERY_RESULT_BACKEND: redis://notificaties-redis:6379/0
CELERY_LOGLEVEL: DEBUG
CELERY_WORKER_CONCURRENCY: ${CELERY_WORKER_CONCURRENCY:-100}
NOTIFICATION_SEC_INTERVAL: 20
NOTIFICATION_LIMIT: 500

SUBPATH: ${SUBPATH:-/}
DISABLE_2FA: yes
LOG_NOTIFICATIONS_IN_DB: no
DB_CONN_MAX_AGE: "0"
DB_POOL_ENABLED: True
OTEL_SDK_DISABLED: true
healthcheck:
test: ["CMD", "maykin-common", "health-check"]
interval: 30s
timeout: 5s
retries: 5
# This should allow for enough time for migrations to run before the max
# retries have passed. This healthcheck in turn allows other containers
# to wait for the database migrations.
start_period: 30s
ports:
- 8008:8000
volumes: &app-volumes
- media:/app/media # Shared media volume to get access to saved OAS files
depends_on:
notificaties-db:
condition: service_healthy
notificaties-web-init:
condition: service_completed_successfully
networks:
- open-notificaties-dev

notificaties-web-init:
image: openzaak/open-notificaties:${OPENNOTIFICATIES_VERSION:-1.16.2}
environment:
<<: *app-env
RUN_SETUP_CONFIG: ${RUN_SETUP_CONFIG:-true}
command: /setup_configuration.sh
depends_on:
notificaties-db:
condition: service_healthy
notificaties-redis:
condition: service_started
volumes:
- ./setup_configuration:/app/setup_configuration
networks:
- open-notificaties-dev

notificaties-celery:
image: openzaak/open-notificaties:${OPENNOTIFICATIES_VERSION:-1.16.2}
environment: *app-env
command: /celery_worker.sh
healthcheck:
test: [
Comment thread
annashamray marked this conversation as resolved.
"CMD",
"maykin-common",
"worker-health-check",
"--liveness-file=/app/tmp/celery_worker_event_loop.live",
"--max-age=70",
"--broker=redis://redis:6379/0",
"--worker-name=celery@docker",
]
interval: 60s
timeout: 5s
retries: 3
start_period: 10s
volumes: *app-volumes
depends_on:
- notificaties-web
networks:
- open-notificaties-dev

notificaties-celery-beat:
image: openzaak/open-notificaties:${OPENNOTIFICATIES_VERSION:-1.16.2}
environment: *app-env
command: /celery_beat.sh
healthcheck:
test: [
"CMD",
"maykin-common",
"beat-health-check",
"--file=/app/tmp/celery_beat.live",
"--max-age=120"
]
interval: 60s
timeout: 5s
retries: 5
depends_on:
- notificaties-celery
- notificaties-db
- notificaties-redis
volumes: *app-volumes
networks:
- open-notificaties-dev

notificaties-celery-flower:
image: openzaak/open-notificaties:${OPENNOTIFICATIES_VERSION:-1.16.2}
environment: *app-env
command: /celery_flower.sh
ports:
- 5555:5555
depends_on:
- notificaties-redis
- notificaties-celery
healthcheck:
test: [
"CMD",
"maykin-common",
"health-check",
"--endpoint=http://localhost:5555/"
]
networks:
- open-notificaties-dev

volumes:
media:
notificaties-db:

networks:
open-notificaties-dev:
name: open-notificaties-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE ROLE opennotificaties WITH LOGIN;
CREATE DATABASE opennotificaties WITH OWNER opennotificaties;
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
zgw_consumers_config_enable: true
zgw_consumers:
services:
- identifier: open-zaak-auth
label: Open Zaak Auth
api_root: http://localhost:8003/autorisaties/api/v1
api_type: ac
auth_type: zgw
client_id: open-notificaties
secret: this-secret-is-very-secure
- identifier: open-notificaties-api
label: Open Notificaties
api_root: http://localhost:8008/api/v1
api_type: nrc
auth_type: zgw
client_id: open-notificaties
secret: this-secret-is-very-secure

autorisaties_api_config_enable: true
autorisaties_api:
authorizations_api_service_identifier: open-zaak-auth

vng_api_common_credentials_config_enable: true
vng_api_common_credentials:
items:
- identifier: open-notificaties
secret: this-secret-is-very-secure
- identifier: open-product
secret: this-secret-is-very-secure
- identifier: open-zaak
secret: this-secret-is-very-secure

notifications_config_enable: true
notifications_config:
notification_delivery_max_retries: 7
notification_delivery_retry_backoff: 25
notification_delivery_retry_backoff_max: 52000
notification_delivery_base_factor: 4
notifications_api_service_identifier: open-notificaties-api

notifications_subscriptions_config_enable: true
notifications_subscriptions_config:
items:
- uuid: aa4be394-9f89-4291-a0e8-f18b4e7b5ae1
channels:
- autorisaties
identifier: open-notificaties
callback_url: http://localhost:8008/api/v1/callbacks
client_id: open-notificaties
secret: this-secret-is-very-secure

notifications_abonnementen_config_enable: true
notifications_abonnementen_config:
items:
- uuid: c7fea6b4-451d-49b8-8dbc-39c9264746ad
callback_url: http://localhost:8003/events
cloudevent_filters:
# TODO: this also needs to include the product date-change notification
- nl.overheid.zaken.zaak-gekoppeld
- nl.overheid.zaken.zaak-ontkoppeld
auth_type: zgw
auth_client_id: open-zaak
secret: this-secret-is-very-secure
send_cloudevents: true
25 changes: 23 additions & 2 deletions backend/docker-services/openproduct/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ services:
OPENPRODUCT_SUPERUSER_USERNAME: admin
OPENPRODUCT_SUPERUSER_PASSWORD: admin
OPENPRODUCT_SUPERUSER_EMAIL: admin@admin.org
# Cloudevents
ENABLE_CLOUD_EVENTS: True
NOTIFICATIONS_SOURCE: open-product-docker
healthcheck:
test: [ "CMD", "python", "-c", "import requests; exit(requests.head('http://localhost:8000/admin/').status_code not in [200, 302])" ]
interval: 30s
Expand All @@ -53,13 +56,31 @@ services:
ports:
- 8007:8000
depends_on:
- openproduct-db
- openproduct-redis
openproduct-db:
condition: service_started
openproduct-redis:
condition: service_started
openproduct-web-init:
condition: service_completed_successfully
volumes: &web_volumes
- ./fixtures/:/app/fixtures/
networks:
- openproduct-dev

openproduct-web-init:
image: maykinmedia/open-product:${OPENPRODUCT_VERSION:-1.8.0}
environment:
<<: *web_env
RUN_SETUP_CONFIG: ${RUN_SETUP_CONFIG:-true}
command: /setup_configuration.sh
depends_on:
- openproduct-db
- openproduct-redis
volumes:
- ./setup_configuration:/app/setup_configuration
networks:
- openproduct-dev

# mount fixtures dir to automatically populate the DB
openproduct-web-fixtures:
image: maykinmedia/open-product:${OPENPRODUCT_VERSION:-1.8.0}
Expand Down
18 changes: 18 additions & 0 deletions backend/docker-services/openproduct/setup_configuration/data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
zgw_consumers_config_enable: true
zgw_consumers:
services:
- identifier: open-notificaties-api
label: Open Notificaties API
api_root: http://localhost:8008/api/v1
api_type: nrc
auth_type: zgw
client_id: open-product
secret: this-secret-is-very-secure

notifications_config_enable: true
notifications_config:
Comment thread
viktorvanwijk marked this conversation as resolved.
notification_delivery_max_retries: 7
notification_delivery_retry_backoff: 25
notification_delivery_retry_backoff_max: 52000
notification_delivery_base_factor: 4
notifications_api_service_identifier: open-notificaties-api
4 changes: 4 additions & 0 deletions backend/docker-services/openzaak/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ services:
CELERY_WORKER_CONCURRENCY: ${CELERY_WORKER_CONCURRENCY:-2}
DISABLE_2FA: yes
OTEL_SDK_DISABLED: True
# Cloudevents
ENABLE_CLOUD_EVENTS: True
NOTIFICATIONS_SOURCE: open-zaak-docker
SITE_DOMAIN: openzaak-web.local:8000
healthcheck:
test: [ "CMD", "python", "-c", "import requests; exit(requests.head('http://localhost:8000/admin/').status_code not in [200, 302])" ]
interval: 30s
Expand Down
34 changes: 33 additions & 1 deletion backend/docker-services/openzaak/setup_configuration/data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,35 @@ sites_config:
- domain: localhost:8003
name: Open Zaak Docker compose

notifications_config_enable: false
zgw_consumers_config_enable: true
zgw_consumers:
services:
- identifier: open-notificaties-api
label: Open Notificaties API
api_root: http://localhost:8008/api/v1
api_type: nrc
auth_type: zgw
client_id: open-zaak
secret: this-secret-is-very-secure


notifications_config_enable: true
notifications_config:
notification_delivery_max_retries: 7
notification_delivery_retry_backoff: 25
notification_delivery_retry_backoff_max: 52000
notification_delivery_base_factor: 4
notifications_api_service_identifier: open-notificaties-api

vng_api_common_credentials_config_enable: true
vng_api_common_credentials:
items:
- identifier: test-vcr
secret: test-vcr
- identifier: open-notificaties
secret: this-secret-is-very-secure
- identifier: open-zaak
secret: this-secret-is-very-secure

vng_api_common_applicaties_config_enable: true
vng_api_common_applicaties:
Expand All @@ -20,5 +42,15 @@ vng_api_common_applicaties:
- test-vcr
label: Open Archiefbeheer test
heeft_alle_autorisaties: true
- uuid: 19638c8d-04a0-4ad7-bddd-46432c48c1b9
client_ids:
- open-notificaties
label: Open Notificaties
heeft_alle_autorisaties: true
- uuid: 3f5373ed-b698-42f3-b96b-2246e8f48a54
client_ids:
- open-zaak
label: Open Zaak
heeft_alle_autorisaties: true

oidc_db_config_enable: false
3 changes: 2 additions & 1 deletion backend/docker-services/start_services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ check_docker() {
}

check_docker_linux() {
if ! curl -s -X GET http://127.0.0.1:2375/_ping | grep -q "OK"; then
if ! docker info >/dev/null 2>&1; then
log_info "Docker not running. Restarting..."
sudo systemctl stop docker.service
sudo dockerd \
Expand Down Expand Up @@ -66,3 +66,4 @@ docker compose -f openzaak/docker-compose.yaml up -d
docker compose -f openklant/docker-compose.yaml up -d
docker compose -f objecten/docker-compose.yaml up -d
docker compose -f openproduct/docker-compose.yaml up -d
docker compose -f opennotificaties/docker-compose.yaml up -d
Loading
Loading