Skip to content

Commit 10315ac

Browse files
committed
docker: add container HEALTHCHECK for CodeChecker web
Use Python stdlib to probe the built-in /live endpoint without adding curl. Fixes #4564
1 parent 463081e commit 10315ac

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

web/docker/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ RUN chmod 755 /usr/local/bin/wait-for
139139

140140
EXPOSE 8001
141141

142+
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
143+
CMD python3 -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8001/live', timeout=3).read()" || exit 1
144+
142145
ENTRYPOINT ["/tini", "--", "/usr/local/bin/entrypoint.sh"]
143146

144147
CMD ["CodeChecker", "server", "--workspace", "/workspace", "--not-host-only"]

0 commit comments

Comments
 (0)