Production config for new redis image

This commit is contained in:
Mouse Reeve 2021-03-23 20:05:45 -07:00
parent f97efc2f86
commit af72488cd9
5 changed files with 19 additions and 10 deletions

View file

@ -23,10 +23,16 @@ POSTGRES_USER=fedireads
POSTGRES_DB=fedireads
POSTGRES_HOST=db
REDIS_PORT=6379
REDIS_PASSWORD=redispassword123
CELERY_BROKER=redis://:${REDIS_PASSWORD}@redis:${REDIS_PORT}/0
CELERY_RESULT_BACKEND=redis://:${REDIS_PASSWORD}@redis:${REDIS_PORT}/0
# Redis as activitystreams manager
REDIS_ACTIVITY_HOST=redis_activity
REDIS_ACTIVITY_PORT=6379
REDIS_ACTIVITY_PASSWORD=redispassword345
# Redis as celery broker
REDIS_BROKER_PORT=6379
REDIS_BROKER_PASSWORD=redispassword123
CELERY_BROKER=redis://:${REDIS_BROKER_PASSWORD}@redis_broker:${REDIS_BROKER_PORT}/0
CELERY_RESULT_BACKEND=redis://:${REDIS_BROKER_PASSWORD}@redis_broker:${REDIS_BROKER_PORT}/0
FLOWER_PORT=8888
FLOWER_USER=mouse

View file

@ -8,7 +8,10 @@ from bookwyrm import models, settings
from bookwyrm.views.helpers import privacy_filter
r = redis.Redis(
host=settings.REDIS_ACTIVITY_HOST, port=settings.REDIS_ACTIVITY_PORT, db=0
host=settings.REDIS_ACTIVITY_HOST,
port=settings.REDIS_ACTIVITY_PORT,
password=settings.REDIS_ACTIVITY_PASSWORD,
db=0
)

View file

@ -95,6 +95,7 @@ WSGI_APPLICATION = "bookwyrm.wsgi.application"
# redis/activity streams settings
REDIS_ACTIVITY_HOST = env("REDIS_ACTIVITY_HOST", "localhost")
REDIS_ACTIVITY_PORT = env("REDIS_ACTIVITY_PORT", 6379)
REDIS_ACTIVITY_PASSWORD = env("REDIS_ACTIVITY_PASSWORD")
MAX_STREAM_LENGTH = env("MAX_STREAM_LENGTH", 200)
STREAMS = ["home", "local", "federated"]

4
bw-dev
View file

@ -28,10 +28,6 @@ function initdb {
execweb python manage.py initdb
}
function makeitblack {
docker-compose run --rm web black celerywyrm bookwyrm
}
CMD=$1
shift

View file

@ -52,6 +52,9 @@ services:
- 8000:8000
redis_activity:
image: redis
command: redis-server --requirepass ${REDIS_ACTIVITY_PASSWORD}
volumes:
- ./redis.conf:/etc/redis/redis.conf
env_file: .env
ports:
- 6378:6378
@ -60,7 +63,7 @@ services:
restart: on-failure
redis_broker:
image: redis
command: redis-server --requirepass ${REDIS_PASSWORD}
command: redis-server --requirepass ${REDIS_BROKER_PASSWORD}
volumes:
- ./redis.conf:/etc/redis/redis.conf
env_file: .env