This commit is contained in:
parent
b80839e448
commit
dd10015927
@ -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"]
|
||||
|
Loading…
Reference in New Issue
Block a user