From 85371b61fff1745f8c5b44c7bbb7ed9a63f8493d Mon Sep 17 00:00:00 2001 From: ChrQR Date: Thu, 30 May 2024 00:28:56 +0200 Subject: [PATCH] scraper dockerfile --- scrapers/Dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scrapers/Dockerfile b/scrapers/Dockerfile index e0c7970..865b946 100644 --- a/scrapers/Dockerfile +++ b/scrapers/Dockerfile @@ -4,22 +4,21 @@ FROM python:3.9-slim # Set the working directory in the container WORKDIR /app -# Install cron and any needed packages specified in requirements.txt -RUN apt-get update && apt-get install -y cron \ - && pip install --no-cache-dir -r requirements.txt - # Copy the current directory contents into the container at /app COPY . /app +# Ensure cron is installed +RUN apt get update && apt get install -y cron + +# Install any needed packages specified in requirements.txt +RUN pip install --no-cache-dir -r requirements.txt + # Copy the crontab file to the cron.d directory COPY crontab /etc/cron.d/scraper-cron # Give execution rights on the cron job RUN chmod 0644 /etc/cron.d/scraper-cron -# Apply cron job -RUN crontab /etc/cron.d/scraper-cron - # Create the log file to be able to run tail RUN touch /var/log/cron.log