Knack-Scraper/Dockerfile
quorploop bcd210ce01 Dockerized Scraper
- Implements Dockerized Version of Scraper
- Atomized tags and categories columns
2025-12-20 20:55:04 +01:00

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"]