diff --git a/deploy/settings_local.py b/deploy/settings_local.py index 6f7ccf0d..6dbee1a8 100644 --- a/deploy/settings_local.py +++ b/deploy/settings_local.py @@ -89,8 +89,9 @@ CIMAR_PASSWORD = "" # Celery settings — when running in docker the redis service is # reachable at the `redis` hostname provided by docker compose. -CELERY_BROKER_URL = "redis://redis:6379" -CELERY_RESULT_BACKEND = "redis://redis:6379" +REDIS_HOST = os.environ.get("REDIS_HOST", "redis") +CELERY_BROKER_URL = f"redis://{REDIS_HOST}:6379" +CELERY_RESULT_BACKEND = f"redis://{REDIS_HOST}:6379" DATABASES = { "default": { diff --git a/deploy/settings_local.py.example b/deploy/settings_local.py.example index 65ec41f9..d3943f2f 100644 --- a/deploy/settings_local.py.example +++ b/deploy/settings_local.py.example @@ -56,5 +56,6 @@ CIMAR_PASSWORD = "" # Celery settings — when running in docker the redis service is # reachable at the `redis` hostname provided by docker compose. -CELERY_BROKER_URL = "redis://redis:6379" -CELERY_RESULT_BACKEND = "redis://redis:6379" +REDIS_HOST = os.environ.get("REDIS_HOST", "redis") +CELERY_BROKER_URL = f"redis://{REDIS_HOST}:6379" +CELERY_RESULT_BACKEND = f"redis://{REDIS_HOST}:6379" diff --git a/rad/settings.py b/rad/settings.py index 97fca391..bf40e409 100644 --- a/rad/settings.py +++ b/rad/settings.py @@ -381,8 +381,9 @@ CIMAR_USERNAME = "" CIMAR_PASSWORD = "" # Celery settings -CELERY_BROKER_URL = "redis://redis:6379" -CELERY_RESULT_BACKEND = "redis://redis:6379" +REDIS_HOST = os.environ.get("REDIS_HOST", "redis") +CELERY_BROKER_URL = f"redis://{REDIS_HOST}:6379" +CELERY_RESULT_BACKEND = f"redis://{REDIS_HOST}:6379" # Django 6 task framework settings. # Use DJANGO_TASK_BACKEND to select your backend implementation. @@ -403,7 +404,7 @@ CHANNEL_LAYERS = { "default": { "BACKEND": "channels_redis.core.RedisChannelLayer", "CONFIG": { - "hosts": [("redis", 6379)], + "hosts": [(REDIS_HOST, 6379)], }, }, }