HSWroFlipdotWeather/Dockerfile

19 lines
562 B
Docker

FROM python:3.9-slim
RUN apt-get update && apt-get install --assume-yes \
cron \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt /app
RUN pip install --no-cache-dir -r requirements.txt
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 "*/30 * * * * 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