Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
build(docker): change the broker URL environment variable in the appl…
Browse files Browse the repository at this point in the history
…ication
  • Loading branch information
bitterteriyaki committed Nov 29, 2023
1 parent d7e05bc commit 334e06c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker/django/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES

: "${RABBITMQ_HOST:=rabbitmq}"
: "${RABBITMQ_PORT:=5672}"
export CELERY_BROKER_URL="amqp://${RABBITMQ_USER}:${RABBITMQ_PASSWORD}@${RABBITMQ_HOST}:${RABBITMQ_PORT}/${RABBITMQ_VHOST}"
export CLOUDAMQP_URL="amqp://${RABBITMQ_USER}:${RABBITMQ_PASSWORD}@${RABBITMQ_HOST}:${RABBITMQ_PORT}/${RABBITMQ_VHOST}"

# We need this line to make sure that this container is started after the one
# with PostgreSQL:
Expand Down
7 changes: 6 additions & 1 deletion server/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
from celery import Celery
from celery.app.task import Task

from server.settings import env

environ.setdefault("DJANGO_SETTINGS_MODULE", "server.settings.development")

app = Celery("virtualjudge", broker_connection_retry_on_startup=False)
broker = env("CLOUDAMQP_URL", default="")
app = Celery(
"virtualjudge", broker=broker, broker_connection_retry_on_startup=False
)

app.config_from_object("django.conf:settings", namespace="CELERY")
app.autodiscover_tasks()
Expand Down

0 comments on commit 334e06c

Please sign in to comment.