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
  • Loading branch information
andrew-kennedy committed Jul 22, 2023
1 parent a664ba1 commit ff4375c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
PORT=$(jq .port /.filebrowser.json)
curl -f http://localhost:$PORT/health || exit 1

0 comments on commit ff4375c

Please sign in to comment.