From 7697ef05a2ecd9f5e7a029138ba20c8cfa86d3b9 Mon Sep 17 00:00:00 2001 From: Dalia Coss Date: Tue, 18 May 2021 16:20:25 -0600 Subject: [PATCH] Add support for WEBSOCKET_SCHEME and WEBSOCKET_HOSTNAME env vars in Docker config template and entrypoint --- docker/config.json.template | 2 +- docker/entrypoint.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/config.json.template b/docker/config.json.template index 0711374..d41afce 100644 --- a/docker/config.json.template +++ b/docker/config.json.template @@ -1,3 +1,3 @@ { - "wsUrl": "ws://${WEBSOCKET_HOST}:${WEBSOCKET_PORT}/websocket" + "wsUrl": "${WEBSOCKET_SCHEME}${WEBSOCKET_HOSTNAME}:${WEBSOCKET_PORT}/websocket" } diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index e36867a..cabb30e 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,3 +1,5 @@ #!/bin/sh -envsubst < /config.json.template > "/usr/share/nginx/html/config.json" +WEBSOCKET_SCHEME="${WEBSOCKET_SCHEME:-ws://}" \ + WEBSOCKET_HOSTNAME="${WEBSOCKET_HOSTNAME:-${WEBSOCKET_HOST}}" \ + envsubst < /config.json.template > "/usr/share/nginx/html/config.json"