forked from lukaszett/Knack-Scraper
Dockerized Scraper
- Implements Dockerized Version of Scraper - Atomized tags and categories columns
This commit is contained in:
parent
7cc3d1b7e4
commit
bcd210ce01
5 changed files with 201 additions and 42 deletions
22
Dockerfile
22
Dockerfile
|
|
@ -7,9 +7,21 @@ WORKDIR /app
|
|||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
RUN apt update -y
|
||||
RUN apt install -y cron
|
||||
COPY crontab .
|
||||
RUN crontab crontab
|
||||
COPY .env .
|
||||
|
||||
COPY main.py .
|
||||
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"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue