mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-15 01:14:53 +03:00
Add rabbitmq
This commit is contained in:
parent
e60084fee1
commit
bb111c0329
|
@ -11,6 +11,9 @@ REDIS_URL=redis://redis:6379/0
|
|||
# Celery
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# RabbitMQ
|
||||
RABBITMQ_URL=amqp://user:bitnami@rabbitmq:5672/
|
||||
|
||||
# Flower
|
||||
CELERY_FLOWER_USER=!!!SET CELERY_FLOWER_USER!!!
|
||||
CELERY_FLOWER_PASSWORD=!!!SET CELERY_FLOWER_PASSWORD!!!
|
||||
|
|
|
@ -65,6 +65,9 @@ REDIS_URL=redis://redis:6379/0
|
|||
# Celery
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# RabbitMQ
|
||||
RABBITMQ_URL=amqp://user:bitnami@rabbitmq:5672/
|
||||
|
||||
# Flower
|
||||
CELERY_FLOWER_USER=!!!SET CELERY_FLOWER_USER!!!
|
||||
CELERY_FLOWER_PASSWORD=!!!SET CELERY_FLOWER_PASSWORD!!!
|
||||
|
|
|
@ -7,7 +7,7 @@ set -o nounset
|
|||
|
||||
{% if cookiecutter.use_celery == 'y' %}
|
||||
# N.B. If only .env files supported variable expansion...
|
||||
export CELERY_BROKER_URL="${REDIS_URL}"
|
||||
export CELERY_BROKER_URL="${RABBITMQ_URL}"
|
||||
{% endif %}
|
||||
|
||||
if [ -z "${POSTGRES_USER}" ]; then
|
||||
|
|
|
@ -273,7 +273,7 @@ if USE_TZ:
|
|||
# http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-broker_url
|
||||
CELERY_BROKER_URL = env("CELERY_BROKER_URL")
|
||||
# http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-result_backend
|
||||
CELERY_RESULT_BACKEND = CELERY_BROKER_URL
|
||||
CELERY_RESULT_BACKEND = "rpc"
|
||||
# http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-accept_content
|
||||
CELERY_ACCEPT_CONTENT = ["json"]
|
||||
# http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-task_serializer
|
||||
|
|
|
@ -47,16 +47,18 @@ services:
|
|||
{%- endif %}
|
||||
{%- if cookiecutter.use_celery == 'y' %}
|
||||
|
||||
redis:
|
||||
image: redis:5.0
|
||||
container_name: redis
|
||||
rabbitmq:
|
||||
image: 'bitnami/rabbitmq:latest'
|
||||
container_name: rabbitmq
|
||||
ports:
|
||||
- '5672:5672'
|
||||
|
||||
celeryworker:
|
||||
<<: *django
|
||||
image: {{ cookiecutter.project_slug }}_local_celeryworker
|
||||
container_name: celeryworker
|
||||
depends_on:
|
||||
- redis
|
||||
- rabbitmq
|
||||
- postgres
|
||||
{% if cookiecutter.use_mailhog == 'y' -%}
|
||||
- mailhog
|
||||
|
@ -69,7 +71,7 @@ services:
|
|||
image: {{ cookiecutter.project_slug }}_local_celerybeat
|
||||
container_name: celerybeat
|
||||
depends_on:
|
||||
- redis
|
||||
- rabbitmq
|
||||
- postgres
|
||||
{% if cookiecutter.use_mailhog == 'y' -%}
|
||||
- mailhog
|
||||
|
@ -81,6 +83,8 @@ services:
|
|||
<<: *django
|
||||
image: {{ cookiecutter.project_slug }}_local_flower
|
||||
container_name: flower
|
||||
depends_on:
|
||||
- rabbitmq
|
||||
ports:
|
||||
- "5555:5555"
|
||||
command: /start-flower
|
||||
|
|
|
@ -50,6 +50,11 @@ services:
|
|||
image: redis:5.0
|
||||
{%- if cookiecutter.use_celery == 'y' %}
|
||||
|
||||
rabbitmq:
|
||||
image: 'bitnami/rabbitmq:latest'
|
||||
ports:
|
||||
- '5672:5672'
|
||||
|
||||
celeryworker:
|
||||
<<: *django
|
||||
image: {{ cookiecutter.project_slug }}_production_celeryworker
|
||||
|
|
Loading…
Reference in New Issue
Block a user