docker-healthcheck/Dockerfile

22 lines
685 B
Docker
Raw Permalink Normal View History

2024-01-02 11:13:21 +00:00
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" ]