diff --git a/.env.example b/.env.example index 7a67045c..7f80a72c 100644 --- a/.env.example +++ b/.env.example @@ -22,8 +22,13 @@ POSTGRES_USER=fedireads POSTGRES_DB=fedireads POSTGRES_HOST=db -CELERY_BROKER=redis://redis:6379/0 -CELERY_RESULT_BACKEND=redis://redis:6379/0 +# Redis activity stream manager +REDIS_ACTIVITY_HOST=redis_activity +REDIS_ACTIVITY_PORT=6379 + +# Celery config with redis broker +CELERY_BROKER=redis://redis_broker:6379/0 +CELERY_RESULT_BACKEND=redis://redis_broker:6379/0 EMAIL_HOST="smtp.mailgun.org" EMAIL_PORT=587 diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py index bcff5828..cd844850 100644 --- a/bookwyrm/settings.py +++ b/bookwyrm/settings.py @@ -92,6 +92,9 @@ TEMPLATES = [ WSGI_APPLICATION = "bookwyrm.wsgi.application" +# redis +REDIS_ACTIVITY_HOST = env("REDIS_ACTIVITY_HOST", "localhost") +REDIS_ACTIVITY_PORT = env("REDIS_ACTIVITY_PORT", 6379) # Database # https://docs.djangoproject.com/en/2.0/ref/settings/#databases diff --git a/docker-compose.yml b/docker-compose.yml index 5d9cbf1b..3ee9037f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,11 +31,20 @@ services: depends_on: - db - celery_worker + - redis_activity networks: - main ports: - 8000:8000 - redis: + redis_activity: + image: redis + env_file: .env + ports: + - 6378:6378 + networks: + - main + restart: on-failure + redis_broker: image: redis env_file: .env ports: @@ -55,7 +64,7 @@ services: - media_volume:/app/images depends_on: - db - - redis + - redis_broker restart: on-failure flower: build: . @@ -67,7 +76,7 @@ services: - main depends_on: - db - - redis + - redis_broker restart: on-failure ports: - 8888:8888