Skip to content

Commit

Permalink
add REDIS_MAIN_* and REDIS_CACHE_* env vars
Browse files Browse the repository at this point in the history
Co-authored-by: Tobias McNulty <tobiasmcnulty@users.noreply.github.com>
  • Loading branch information
copelco and tobiasmcnulty committed Jan 8, 2024
1 parent f3b1371 commit 9f54d62
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ services:
- DOMAIN=${DOMAIN}
- SUPPORT_EMAIL=${SYSADMIN_EMAIL}
- HTTPS_PORT=${HTTPS_PORT:-443}
- REDIS_MAIN_HOST=enketo_redis_main
- REDIS_MAIN_PORT=6379
- REDIS_CACHE_HOST=enketo_redis_cache
- REDIS_CACHE_PORT=6380
enketo_redis_main:
image: redis:7.2
volumes:
Expand Down
8 changes: 4 additions & 4 deletions files/enketo/config.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
"query parameter to pass to submission": "st",
"redis": {
"main": {
"host": "enketo_redis_main",
"port": "6379"
"host": "${REDIS_MAIN_HOST}",
"port": "${REDIS_MAIN_PORT}"
},
"cache": {
"host": "enketo_redis_cache",
"port": "6380"
"host": "${REDIS_CACHE_HOST}",
"port": "${REDIS_CACHE_PORT}"
}
},
"support": {
Expand Down
2 changes: 1 addition & 1 deletion files/enketo/start-enketo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BASE_URL=$( [ "${HTTPS_PORT}" = 443 ] && echo https://"${DOMAIN}" || echo https:
SECRET=$(cat /etc/secrets/enketo-secret) \
LESS_SECRET=$(cat /etc/secrets/enketo-less-secret) \
API_KEY=$(cat /etc/secrets/enketo-api-key) \
envsubst '$DOMAIN $BASE_URL $SECRET $LESS_SECRET $API_KEY $SUPPORT_EMAIL' \
envsubst '$DOMAIN $BASE_URL $SECRET $LESS_SECRET $API_KEY $SUPPORT_EMAIL $REDIS_MAIN_HOST $REDIS_MAIN_PORT $REDIS_CACHE_HOST $REDIS_CACHE_PORT' \
< "$CONFIG_PATH.template" \
> "$CONFIG_PATH"

Expand Down

0 comments on commit 9f54d62

Please sign in to comment.