From 315a80f66bee04e7fee99db2cd1a291d19aa3dc7 Mon Sep 17 00:00:00 2001 From: mtyton Date: Sun, 24 Sep 2023 17:38:02 +0200 Subject: [PATCH] Added celery to prod docker-compose --- artel/docker-compose-prod.yml | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/artel/docker-compose-prod.yml b/artel/docker-compose-prod.yml index 237b033..afd1b88 100644 --- a/artel/docker-compose-prod.yml +++ b/artel/docker-compose-prod.yml @@ -16,6 +16,16 @@ services: networks: - nginx_network + rabbit: + hostname: rabbit + image: rabbitmq:3.6.0 + environment: + - RABBITMQ_DEFAULT_USER + - RABBITMQ_DEFAULT_PASS + ports: + - "5672:5672" # We forward this port because it's useful for debugging + - "15672:15672" # Here, we can access RabbitMQ management plugin + comfy: build: dockerfile: Dockerfile @@ -52,6 +62,40 @@ services: networks: - nginx_network + beat: + build: + context: . + dockerfile: Dockerfile + command: celery -A artel beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler + volumes: + - ./:/app + env_file: + - .env + environment: + - SECRET_KEY + - DATABASE_URL + depends_on: + - comfy + - rabbit + + worker: + build: + context: . + dockerfile: Dockerfile + command: celery -A artel worker -l info + volumes: + - ./:/app + - ./media:/app/media + env_file: + - .env + environment: + - SECRET_KEY + - DATABASE_URL + depends_on: + - comfy + - rabbit + - beat + networks: nginx_network: driver: bridge