mirror of
https://github.com/netbootxyz/docker-netbootxyz.git
synced 2025-08-06 22:27:41 +02:00
Merge pull request #86 from netbootxyz/healthchecks
Add container healthchecks
This commit is contained in:
commit
994dc608a9
@ -64,5 +64,6 @@ EXPOSE 3000
|
|||||||
|
|
||||||
COPY root/ /
|
COPY root/ /
|
||||||
|
|
||||||
# default command
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 CMD /healthcheck.sh
|
||||||
|
|
||||||
CMD ["sh","/start.sh"]
|
CMD ["sh","/start.sh"]
|
||||||
|
21
root/healthcheck.sh
Executable file
21
root/healthcheck.sh
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Check TFTP (UDP 69)
|
||||||
|
if ! nc -z -u -w2 127.0.0.1 69; then
|
||||||
|
echo "TFTP check failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check HTTP (nginx)
|
||||||
|
if ! curl -fs http://127.0.0.1:${NGINX_PORT:-80}/ > /dev/null; then
|
||||||
|
echo "HTTP check failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check Web App
|
||||||
|
if ! curl -fs http://127.0.0.1:${WEB_APP_PORT:-3000}/ > /dev/null; then
|
||||||
|
echo "Web App check failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
Loading…
Reference in New Issue
Block a user