瀏覽代碼

Added healthcheck url environemnt variable

Marcel 3 年之前
父節點
當前提交
f750235933
共有 3 個文件被更改,包括 9 次插入6 次删除
  1. 3 2
      Dockerfile
  2. 3 2
      Dockerfile.arm
  3. 3 2
      Dockerfile.arm64

+ 3 - 2
Dockerfile

@@ -77,6 +77,8 @@ RUN dotnet publish Jellyfin.Server --disable-parallel --configuration Release --
 
 
 FROM app
 FROM app
 
 
+ENV HEALTHCHECK_URL=http://localhost:8096/health
+
 COPY --from=builder /jellyfin /jellyfin
 COPY --from=builder /jellyfin /jellyfin
 COPY --from=web-builder /dist /jellyfin/jellyfin-web
 COPY --from=web-builder /dist /jellyfin/jellyfin-web
 
 
@@ -88,5 +90,4 @@ ENTRYPOINT ["./jellyfin/jellyfin", \
     "--ffmpeg", "/usr/lib/jellyfin-ffmpeg/ffmpeg"]
     "--ffmpeg", "/usr/lib/jellyfin-ffmpeg/ffmpeg"]
 
 
 HEALTHCHECK --interval=30s --timeout=30s --start-period=10s --retries=3 \
 HEALTHCHECK --interval=30s --timeout=30s --start-period=10s --retries=3 \
-    CMD  curl http://localhost:$(grep -oP '(?<=HttpServerPortNumber>)[^<]+' /config/config/network.xml)/$(grep -oP '(?<=BaseUrl>)[^<]+' /config/config/network.xml)health \
-    || exit 1
+     CMD curl -L "${HEALTHCHECK_URL}" || exit 1

+ 3 - 2
Dockerfile.arm

@@ -68,6 +68,8 @@ RUN dotnet publish Jellyfin.Server --configuration Release --output="/jellyfin"
 
 
 FROM app
 FROM app
 
 
+ENV HEALTHCHECK_URL=http://localhost:8096/health
+
 COPY --from=builder /jellyfin /jellyfin
 COPY --from=builder /jellyfin /jellyfin
 COPY --from=web-builder /dist /jellyfin/jellyfin-web
 COPY --from=web-builder /dist /jellyfin/jellyfin-web
 
 
@@ -79,5 +81,4 @@ ENTRYPOINT ["./jellyfin/jellyfin", \
     "--ffmpeg", "/usr/lib/jellyfin-ffmpeg/ffmpeg"]
     "--ffmpeg", "/usr/lib/jellyfin-ffmpeg/ffmpeg"]
 
 
 HEALTHCHECK --interval=30s --timeout=30s --start-period=10s --retries=3 \
 HEALTHCHECK --interval=30s --timeout=30s --start-period=10s --retries=3 \
-    CMD  curl http://localhost:$(grep -oP '(?<=HttpServerPortNumber>)[^<]+' /config/config/network.xml)/$(grep -oP '(?<=BaseUrl>)[^<]+' /config/config/network.xml)health \
-    || exit 1
+     CMD curl -L "${HEALTHCHECK_URL}" || exit 1

+ 3 - 2
Dockerfile.arm64

@@ -59,6 +59,8 @@ RUN dotnet publish Jellyfin.Server --configuration Release --output="/jellyfin"
 
 
 FROM app
 FROM app
 
 
+ENV HEALTHCHECK_URL=http://localhost:8096/health
+
 COPY --from=builder /jellyfin /jellyfin
 COPY --from=builder /jellyfin /jellyfin
 COPY --from=web-builder /dist /jellyfin/jellyfin-web
 COPY --from=web-builder /dist /jellyfin/jellyfin-web
 
 
@@ -70,5 +72,4 @@ ENTRYPOINT ["./jellyfin/jellyfin", \
     "--ffmpeg", "/usr/bin/ffmpeg"]
     "--ffmpeg", "/usr/bin/ffmpeg"]
 
 
 HEALTHCHECK --interval=30s --timeout=30s --start-period=10s --retries=3 \
 HEALTHCHECK --interval=30s --timeout=30s --start-period=10s --retries=3 \
-    CMD  curl http://localhost:$(grep -oP '(?<=HttpServerPortNumber>)[^<]+' /config/config/network.xml)/$(grep -oP '(?<=BaseUrl>)[^<]+' /config/config/network.xml)health \
-    || exit 1
+     CMD curl -L "${HEALTHCHECK_URL}" || exit 1