docker-healthcheck/Dockerfile
2024-01-02 12:14:26 +01:00

22 lines
685 B
Docker

FROM docker:cli
ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3 py3-pip && ln -sf python3 /usr/bin/python
COPY requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt --break-system-packages --no-cache-dir
COPY docker-healthcheck.py /app/docker-healthcheck.py
RUN chmod +x /app/docker-healthcheck.py
RUN apk add --no-cache cronie
COPY docker-healthcheck-cron /etc/cron.d/docker-healthcheck-cron
RUN chmod 0644 /etc/cron.d/docker-healthcheck-cron
RUN mkdir -p /root/.cache
RUN crontab /etc/cron.d/docker-healthcheck-cron
RUN touch /var/log/docker-healthcheck.log
ENTRYPOINT [ "sh", "-c", "crond & tail -f /var/log/docker-healthcheck.log" ]