From dd1001592752a8f5ffa35a698e3b095587223ca8 Mon Sep 17 00:00:00 2001 From: christian Date: Sat, 1 Jun 2024 17:59:08 +0200 Subject: [PATCH] apt cron --- scrapers/Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scrapers/Dockerfile b/scrapers/Dockerfile index b34c94d..277114a 100644 --- a/scrapers/Dockerfile +++ b/scrapers/Dockerfile @@ -11,6 +11,11 @@ COPY requirements.txt /app/ # Install the required Python packages RUN pip install -r requirements.txt +# Install cron and create log file +RUN apt-get update \ + && apt-get -y install cron \ + && touch /var/log/cron.log + # Copy the cron job file into the cron directory COPY cronjob /etc/cron.d/jobindex-cron @@ -20,8 +25,5 @@ RUN chmod 0644 /etc/cron.d/jobindex-cron # Apply cron job RUN crontab /etc/cron.d/jobindex-cron -# Create the log file to be able to run tail -RUN touch /var/log/cron.log - # Run the command on container startup -CMD cron && tail -f /var/log/cron.log +CMD ["cron", "-f"]