diff --git a/api/Dockerfile b/api/Dockerfile index c038cb3..310e7cc 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,9 +1,19 @@ ARG REGISTRY=rg.fr-par.scw.cloud/geolake ARG TAG=latest FROM $REGISTRY/geolake-datastore:$TAG + +RUN apt update && apt install -y cron + WORKDIR /app COPY requirements.txt /code/requirements.txt RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt COPY app /app EXPOSE 80 + +COPY ./healtcheck.* /opt/ + +RUN chmod +x /opt/healtcheck.sh +RUN crontab -u root /opt/healtcheck.cron +RUN service cron start + CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "80"] diff --git a/api/healtcheck.cron b/api/healtcheck.cron new file mode 100644 index 0000000..e11f6da --- /dev/null +++ b/api/healtcheck.cron @@ -0,0 +1 @@ +*/10 * * * * bash -c '/opt/healtcheck.sh' \ No newline at end of file diff --git a/api/healtcheck.sh b/api/healtcheck.sh new file mode 100644 index 0000000..4d8e479 --- /dev/null +++ b/api/healtcheck.sh @@ -0,0 +1 @@ +curl https://hc-ping.com/$HEALTCHECKS \ No newline at end of file