HSWroFlipdotWeather/Dockerfile

20 lines
561 B
Docker
Raw Permalink Normal View History

2024-11-20 22:09:14 +00:00
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt /app
RUN pip install --no-cache-dir -r requirements.txt
RUN apt-get update && apt-get install --assume-yes \
cron \
&& rm -rf /var/lib/apt/lists/*
COPY . /app
RUN (echo "SHELL=/bin/bash" > /etc/cron.d/fetch_crl_cron)
RUN (echo "BASH_ENV=/app/.env" >> /etc/cron.d/fetch_crl_cron)
RUN (echo "* * * * * root /usr/local/bin/python3 /app/app.py >> /var/log/cron.log 2>&1" >> /etc/cron.d/fetch_crl_cron)
RUN touch /var/log/cron.log
CMD printenv > /etc/environment && cron && tail -f /var/log/cron.log