diff --git a/scrapers/Dockerfile b/scrapers/Dockerfile index 626418e..e970416 100644 --- a/scrapers/Dockerfile +++ b/scrapers/Dockerfile @@ -4,14 +4,14 @@ FROM python:3.9-slim # Set the working directory inside the container WORKDIR /app -# Copy the current directory contents into the container at /app -COPY . /app +# Copy the script and requirements.txt into the container at /app +COPY jobindex.py /app/ +COPY requirements.txt /app/ -# Install cron and the required Python packages -RUN apt-get update && apt-get install -y cron && \ - pip install requests beautifulsoup4 +# Install the required Python packages +RUN pip install -r requirements.txt -# Copy and add a cron job to run the script every hour +# Copy the cron job file into the cron directory COPY cronjob /etc/cron.d/jobindex-cron # Give execution rights on the cron job diff --git a/scrapers/cronjob b/scrapers/cronjob index 49ea0eb..b66c13e 100644 --- a/scrapers/cronjob +++ b/scrapers/cronjob @@ -1,2 +1,2 @@ # Run the jobindex.py script every hour -0 * * * * root python /app/jobindex.py >> /var/log/cron.log 2>&1 +0 * * * * python /app/jobindex.py >> /var/log/cron.log 2>&1