Skip to content

Commit

Permalink
feat: add a healthcheck script that works with a dynamic port (filebr…
Browse files Browse the repository at this point in the history
…owser#2510)

(cherry picked from commit ff4375c)
  • Loading branch information
andrew-kennedy authored and langren1353 committed Jul 31, 2023
1 parent 4f1921b commit 6d78ac2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Dockerfile
@@ -1,10 +1,17 @@
FROM alpine:latest
RUN apk --update add ca-certificates \
mailcap \
curl wget axel git
curl \
jq \
wget \
axel \
git

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

0 comments on commit 6d78ac2

Please sign in to comment.