forked from lukaszett/Knack-Scraper
27 lines
No EOL
598 B
Docker
27 lines
No EOL
598 B
Docker
FROM python:slim
|
|
|
|
RUN mkdir /app
|
|
RUN mkdir /data
|
|
|
|
WORKDIR /app
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY .env .
|
|
|
|
RUN apt update -y
|
|
RUN apt install -y cron locales
|
|
|
|
COPY main.py .
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV LANG=de_DE.UTF-8
|
|
ENV LC_ALL=de_DE.UTF-8
|
|
|
|
# Create cron job that runs every 15 minutes with environment variables
|
|
RUN echo "*/10 * * * * cd /app && /usr/local/bin/python main.py >> /proc/1/fd/1 2>&1" > /etc/cron.d/knack-scraper
|
|
RUN chmod 0644 /etc/cron.d/knack-scraper
|
|
RUN crontab /etc/cron.d/knack-scraper
|
|
|
|
# Start cron in foreground
|
|
CMD ["cron", "-f"] |