From c09a92121182fd2716b570c6eeb442f65de35a92 Mon Sep 17 00:00:00 2001 From: Florian Knappers <73856313+JJFlorian@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:28:45 +0100 Subject: [PATCH] added celery and redis to docker-compose --- bro_hub/settings.py | 2 +- docker-compose.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/bro_hub/settings.py b/bro_hub/settings.py index ea2a74d..32da55f 100644 --- a/bro_hub/settings.py +++ b/bro_hub/settings.py @@ -146,7 +146,7 @@ # Automatically discover tasks in Django app CELERY_IMPORTS = ("api.tasks",) # TODO: fix celery env settings -CELERY_BROKER_URL = "redis://localhost:6379/0" +CELERY_BROKER_URL = "redis://redis:6379/0" # BRO SETTINGS BRO_UITGIFTE_SERVICE_URL = "https://publiek.broservices.nl" diff --git a/docker-compose.yml b/docker-compose.yml index e7a7ab9..644e8f0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,33 @@ services: volumes: - pgdata:/var/lib/postgresql/data restart: unless-stopped + networks: + - backend + + redis: + image: redis:latest + expose: + - 6379 + ports: + - "6379:6379" + networks: + - backend + + celery: + environment: + - DJANGO_SETTINGS_MODULE=bro_hub.settings + - FIELD_ENCRYPTION_KEY="DUMMY-NEEDS-PROD-SETTING-Xgb1GczqZe909UMNc4= + build: . + command: celery -A bro_hub worker --loglevel=INFO + volumes: + - .:/code + links: + - redis + depends_on: + - db + - redis + networks: + - backend web: build: . @@ -32,6 +59,19 @@ services: # - NENS_AUTH_ISSUER # - NENS_AUTH_CLIENT_ID # - NENS_AUTH_CLIENT_SECRET + depends_on: + - db + - redis + - celery + networks: + - backend + + + volumes: pgdata: + +networks: + backend: + name: bro_hub \ No newline at end of file