From 8094b25185caf94be212477110d83c4ce6feb3ab Mon Sep 17 00:00:00 2001 From: bo0tzz Date: Fri, 20 Jan 2023 17:36:13 +0100 Subject: [PATCH] Rebind PUBLIC_* env vars inside web container entrypoint (#1363) --- docker/docker-compose.yml | 4 ---- web/entrypoint.sh | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index bc6f4698bc..ea25ff0653 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -51,10 +51,6 @@ services: entrypoint: ["/bin/sh", "./entrypoint.sh"] env_file: - .env - environment: - # Rename these values for svelte public interface - - PUBLIC_IMMICH_SERVER_URL=${IMMICH_SERVER_URL} - - PUBLIC_IMMICH_API_URL_EXTERNAL=${IMMICH_API_URL_EXTERNAL} restart: always redis: diff --git a/web/entrypoint.sh b/web/entrypoint.sh index b9c9d66721..5f52b7b5ff 100644 --- a/web/entrypoint.sh +++ b/web/entrypoint.sh @@ -1,4 +1,9 @@ #! /bin/sh + +# Rebind env vars to PUBLIC_ for svelte +export PUBLIC_IMMICH_SERVER_URL=$IMMICH_SERVER_URL +export PUBLIC_IMMICH_API_URL_EXTERNAL=$IMMICH_API_URL_EXTERNAL + if [ "$(id -u)" -eq 0 ] && [ -n "$PUID" ] && [ -n "$PGID" ]; then exec setpriv --reuid "$PUID" --regid "$PGID" --clear-groups node /usr/src/app/build/index.js else