mike-jumper commented on code in PR #1119:
URL: https://github.com/apache/guacamole-client/pull/1119#discussion_r2404976531
##########
Dockerfile:
##########
@@ -99,8 +99,11 @@ USER guacamole
# Environment variable defaults
ENV BAN_ENABLED=true \
ENABLE_FILE_ENVIRONMENT_PROPERTIES=true \
- GUACAMOLE_HOME=/etc/guacamole
+ GUACAMOLE_HOME=/etc/guacamole \
+ HEALTH_CHECK_VALVE_ENABLED=true
# Start Guacamole under Tomcat, listening on 0.0.0.0:8080
EXPOSE 8080
+HEALTHCHECK --interval=60s --timeout=10s --start-period=30s \
+ CMD curl --fail --silent --show-error http://localhost:8080/health || exit
1
Review Comment:
We could move the healthcheck implementation into a script and run _that_
instead of directly running `curl`:
```Dockerfile
HEALTHCHECK --interval=60s --timeout=10s --start-period=30s \
CMD [ "/opt/guacamole/bin/healthcheck.sh" ]
```
That would allow the script to deal with pinging
`http://localhost:8080/health` only if `HEALTH_CHECK_VALVE_ENABLED` is `true`,
simply succeeding if not. It would also avoid invoking `curl` unnecessarily,
and would give a future point of expansion if we implement additional checks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]