aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/docker
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-08-14 16:30:47 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-08-14 16:32:40 +0200
commit0bdef57b1950c8e79617104db39e17285686fe3f (patch)
treeff6508a319223c78e76489df47dd423d4a914845 /docker
parentMakefile: add test target (diff)
downloadcgitize-0bdef57b1950c8e79617104db39e17285686fe3f.tar.gz
cgitize-0bdef57b1950c8e79617104db39e17285686fe3f.zip
docker: add HEALTHCHECK
Diffstat (limited to '')
-rw-r--r--docker/Dockerfile2
-rwxr-xr-xdocker/cgitize.sh5
2 files changed, 6 insertions, 1 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 46a2215..8cd256d 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -49,3 +49,5 @@ ENTRYPOINT ["/sbin/tini", "--", "/in_cron.sh"]
WORKDIR /usr/src
CMD ["/cgitize.sh"]
+
+HEALTHCHECK --interval=5m --retries=3 CMD ! test -f /fail
diff --git a/docker/cgitize.sh b/docker/cgitize.sh
index 92fe43c..be33601 100755
--- a/docker/cgitize.sh
+++ b/docker/cgitize.sh
@@ -14,6 +14,7 @@ readonly script_dir
readonly src_dir=/usr/src
readonly cfg_path=/etc/cgitize/cgitize.toml
+readonly fail_path=/fail
secure_repo_dir() {
local dir
@@ -29,11 +30,13 @@ secure_repo_dir() {
setup() {
secure_repo_dir
+ touch -- "$fail_path"
}
run() {
cd -- "$src_dir"
- exec python3 -m cgitize.main "$@"
+ python3 -m cgitize.main "$@"
+ rm -f -- "$fail_path"
}
main() {