diff --git a/Dockerfile b/Dockerfile index 00bc8cc..9d08396 100644 --- a/Dockerfile +++ b/Dockerfile @@ -93,8 +93,8 @@ ENV DEPTH=24 # Show browser instead of running headless ENV SHOW=1 -# mega-linter (KICS, Trivy) complained about it missing - usually this checks some API endpoint, for a container that runs ~1min a healthcheck doesn't make that much sense since playwright has timeouts for everything. Could react to SIGUSR1 and actually check something - for now we just check that node is running... -HEALTHCHECK --interval=10s --timeout=5s CMD pgrep node +# mega-linter (KICS, Trivy) complained about it missing - usually this checks some API endpoint, for a container that runs ~1min a healthcheck doesn't make that much sense since playwright has timeouts for everything. Could react to SIGUSR1 and check something in JS - for now we just check that node is running and noVNC is reachable... +HEALTHCHECK --interval=5s --timeout=5s CMD pgrep node && curl --fail http://localhost:6080 || exit 1 # Script to setup display server & VNC is always executed. ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/docker-compose.yml b/docker-compose.yml index 476e508..dd02113 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,9 +4,9 @@ services: container_name: fgc # is printed in front of every output line image: ghcr.io/vogler/free-games-claimer # otherwise image name will be free-games-claimer-free-games-claimer build: . - healthcheck: # not that useful, but linter complained, see Dockerfile - test: "pgrep node" - interval: 10s + healthcheck: # see Dockerfile, check that node is running and noVNC is reachable + test: pgrep node && curl --fail http://localhost:6080 || exit 1 + interval: 5s timeout: 5s ports: # - "5900:5900" # VNC server