Skip to content

Commit

Permalink
chore(docker): Add HEALTHCHECK
Browse files Browse the repository at this point in the history
- Add curl to Dockerfile using COPY command from another image
- Add HEALTHCHECK to track the status of the Docker container via a specified command
- Increase line spaces for better readability in Dockerfile.

Signed-off-by: 陳鈞 <[email protected]>
  • Loading branch information
jim60105 committed May 27, 2024
1 parent ae8c70b commit 31ac597
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ RUN install -d -m 775 -o $UID -g 0 /home/site/wwwroot && \
# dumb-init
COPY --link --chown=$UID:0 --chmod=775 --from=ghcr.io/jim60105/static-ffmpeg-upx:7.0-1 /dumb-init /usr/bin/

COPY --link --chown=$UID:0 --chmod=775 --from=ghcr.io/tarampampam/curl:8.8.0 /bin/curl /bin/curl
HEALTHCHECK --interval=10s --timeout=2s --retries=3 --start-period=10s CMD [ \
"curl", "--fail", "http://127.0.0.1:8080/api/Utility/Wake/" \
]

# Copy licenses (OpenShift Policy)
COPY --link --chown=$UID:0 --chmod=775 LICENSE /licenses/LICENSE
COPY --link --chown=$UID:0 --chmod=775 --from=ghcr.io/jim60105/yt-dlp:distroless /licenses/yt-dlp.LICENSE /licenses/yt-dlp.LICENSE
Expand Down Expand Up @@ -136,6 +141,7 @@ ENV GITHUB_PROVIDER_AUTHENTICATION_SECRET=
EXPOSE 8080
ENV ASPNETCORE_URLS=http://+:8080


USER $UID

STOPSIGNAL SIGINT
Expand Down

0 comments on commit 31ac597

Please sign in to comment.