Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a healthcheck script that works with a dynamic port. #2510

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions Dockerfile
@@ -1,10 +1,14 @@
FROM alpine:latest
RUN apk --update add ca-certificates \
mailcap \
curl
curl \
jq

COPY healthcheck.sh /healthcheck.sh
RUN chmod +x /healthcheck.sh # Make the script executable

HEALTHCHECK --start-period=2s --interval=5s --timeout=3s \
CMD curl -f http://localhost/health || exit 1
CMD /healthcheck.sh || exit 1

VOLUME /srv
EXPOSE 80
Expand Down
3 changes: 3 additions & 0 deletions healthcheck.sh
@@ -0,0 +1,3 @@
#!/bin/sh
PORT=$(jq .port /.filebrowser.json)
curl -f http://localhost:$PORT/health || exit 1