From e3d7e8e85646440d5ce481ff97a8abf5c290eb68 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Sun, 4 Jan 2026 15:36:32 -0800 Subject: [PATCH] add default values for optional docker env (#1500) --- Dockerfile | 9 ++++++++- docker-compose.yaml | 5 +++-- docker-entrypoint.sh | 7 +++++++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 6078084d0..6e7176de4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,8 +18,15 @@ FROM nginx:alpine-slim COPY --chown=nginx:nginx --from=builder /app/out/web /usr/share/nginx/html COPY ./settings.js.template /etc/nginx/templates/settings.js.template -COPY ng.conf.template /etc/nginx/templates/default.conf.template +COPY ./ng.conf.template /etc/nginx/templates/default.conf.template +COPY ./docker-entrypoint.sh /docker-entrypoint.sh + +RUN chmod +x /docker-entrypoint.sh ENV PUBLIC_PATH="/" +ENV LEGACY_AUTHENTICATION="false" +ENV ANALYTICS_DISABLED="false" + EXPOSE 9180 +ENTRYPOINT ["/docker-entrypoint.sh"] CMD ["nginx", "-g", "daemon off;"] diff --git a/docker-compose.yaml b/docker-compose.yaml index 773ee68ce..73ede9b8d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,7 +1,7 @@ services: feishin: container_name: feishin - image: 'ghcr.io/jeffvli/feishin:latest' + image: ghcr.io/jeffvli/feishin:latest restart: unless-stopped environment: - SERVER_NAME=jellyfin # pre-defined server name @@ -9,6 +9,7 @@ services: - SERVER_TYPE=jellyfin # the allowed types are: jellyfin, navidrome, subsonic. These values are case insensitive - SERVER_URL= # http://address:port or https://address:port - LEGACY_AUTHENTICATION=false # When SERVER_LOCK is true, sets the legacyauth flag for server authentication (true or false) + - ANALYTICS_DISABLED=false # When true, disables analytics ports: - 9180:9180 - # Alternatively, to restrict to only localhost, - 127.0.0.1:9180:8190 \ No newline at end of file + # Alternatively, to restrict to only localhost, - 127.0.0.1:9180:8190 diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 000000000..bb7bd8276 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Set default values for environment variables if not already set +export LEGACY_AUTHENTICATION=${LEGACY_AUTHENTICATION:-false} +export ANALYTICS_DISABLED=${ANALYTICS_DISABLED:-false} + +# Execute the original nginx command +exec "$@"