scraper dockerfile and cronjob to run when container starts
Some checks failed
Build and Push Docker Images / build (push) Failing after 26s

This commit is contained in:
christian 2024-06-01 17:56:06 +02:00
parent 5d01c5a315
commit f0aff65ba1
2 changed files with 7 additions and 7 deletions

View File

@ -4,14 +4,14 @@ FROM python:3.9-slim
# Set the working directory inside the container # Set the working directory inside the container
WORKDIR /app WORKDIR /app
# Copy the current directory contents into the container at /app # Copy the script and requirements.txt into the container at /app
COPY . /app COPY jobindex.py /app/
COPY requirements.txt /app/
# Install cron and the required Python packages # Install the required Python packages
RUN apt-get update && apt-get install -y cron && \ RUN pip install -r requirements.txt
pip install requests beautifulsoup4
# 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 COPY cronjob /etc/cron.d/jobindex-cron
# Give execution rights on the cron job # Give execution rights on the cron job

View File

@ -1,2 +1,2 @@
# Run the jobindex.py script every hour # 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