feat: add a healthcheck script that works with a dynamic port (#2510)
This commit is contained in:
parent
a664ba1f9d
commit
ff4375cf6c
|
@ -1,10 +1,14 @@
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
RUN apk --update add ca-certificates \
|
RUN apk --update add ca-certificates \
|
||||||
mailcap \
|
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 \
|
HEALTHCHECK --start-period=2s --interval=5s --timeout=3s \
|
||||||
CMD curl -f http://localhost/health || exit 1
|
CMD /healthcheck.sh || exit 1
|
||||||
|
|
||||||
VOLUME /srv
|
VOLUME /srv
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
PORT=$(jq .port /.filebrowser.json)
|
||||||
|
curl -f http://localhost:$PORT/health || exit 1
|
Loading…
Reference in New Issue