From 67e6c9bb0049f799da1380b5be3153626c1fa3b2 Mon Sep 17 00:00:00 2001 From: Gabriele Tramonte Date: Wed, 31 Jul 2024 09:31:55 +0200 Subject: [PATCH] adding healtchek to executors --- executor/Dockerfile | 10 ++++++++++ executor/healtcheck.cron | 1 + executor/healtcheck.sh | 1 + 3 files changed, 12 insertions(+) create mode 100644 executor/healtcheck.cron create mode 100644 executor/healtcheck.sh diff --git a/executor/Dockerfile b/executor/Dockerfile index 3888c93..e3404e5 100644 --- a/executor/Dockerfile +++ b/executor/Dockerfile @@ -1,8 +1,18 @@ ARG REGISTRY=rg.fr-par.scw.cloud/geolake ARG TAG=latest FROM $REGISTRY/geolake-datastore:$TAG + +RUN apt update && apt install -y cron curl + + WORKDIR /app COPY requirements.txt /code/requirements.txt RUN pip install --no-cache-dir -r /code/requirements.txt COPY app /app + +COPY ./healtcheck.* /opt/ + +RUN chmod +x /opt/healtcheck.sh +RUN crontab -u root /opt/healtcheck.cron + CMD [ "python", "main.py" ] diff --git a/executor/healtcheck.cron b/executor/healtcheck.cron new file mode 100644 index 0000000..e36bf23 --- /dev/null +++ b/executor/healtcheck.cron @@ -0,0 +1 @@ +*/10 * * * * bash -c '/opt/healtcheck.sh' diff --git a/executor/healtcheck.sh b/executor/healtcheck.sh new file mode 100644 index 0000000..4d8e479 --- /dev/null +++ b/executor/healtcheck.sh @@ -0,0 +1 @@ +curl https://hc-ping.com/$HEALTCHECKS \ No newline at end of file