diff --git a/README.md b/README.md index 4ae66cec4..da5e9e33f 100644 --- a/README.md +++ b/README.md @@ -61,14 +61,12 @@ export PATH=${PATH}:/Applications/Postgres.app/Contents/Versions/11/bin/ ### Redis -To switch redis on you'll need to install it locally. On a OSX we've used brew for this. To use redis caching you need to switch it on by changing the config for development: +To switch redis on you'll need to install it locally e.g. `brew install redis`. To use redis caching you need to switch it on with an environment variable: ``` -REDIS_ENABLED = 1 +export REDIS_ENABLED=1 ``` -Note that if you're running Celery with Docker locally, then you'll also need to set `REDIS_URL=redis://host.docker.internal:6379`. - ## To run the application ``` diff --git a/scripts/run_with_docker.sh b/scripts/run_with_docker.sh index b53d729e4..70933d111 100755 --- a/scripts/run_with_docker.sh +++ b/scripts/run_with_docker.sh @@ -9,13 +9,14 @@ source environment.sh AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-"$(aws configure get aws_access_key_id)"} AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-"$(aws configure get aws_secret_access_key)"} : "${SQLALCHEMY_DATABASE_URI:=postgresql://postgres@host.docker.internal/notification_api}" +REDIS_URL="redis://host.docker.internal:6379" docker run -it --rm \ -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \ -e SQLALCHEMY_DATABASE_URI=$SQLALCHEMY_DATABASE_URI \ -e REDIS_ENABLED=${REDIS_ENABLED:-0} \ - -e REDIS_URL=${REDIS_URL:-''} \ + -e REDIS_URL=$REDIS_URL \ -v $(pwd):/home/vcap/app \ ${DOCKER_IMAGE_NAME} \ ${@}