Remove container cron job and move cron job to main server instead

This commit is contained in:
Keannu Bernasol 2023-10-30 23:01:59 +08:00
parent 0429d7cd25
commit ef8ac8c28c
2 changed files with 0 additions and 21 deletions

View file

@ -18,7 +18,6 @@ RUN apt-get update && apt-get install -y \
libspatialite-dev \ libspatialite-dev \
gdal-bin \ gdal-bin \
libsqlite3-mod-spatialite \ libsqlite3-mod-spatialite \
cron \
vim vim
# Create directory # Create directory
@ -42,23 +41,5 @@ RUN python stude/manage.py custom_migrate
# Generate DRF Spectacular Documentation # Generate DRF Spectacular Documentation
RUN python stude/manage.py spectacular --color --file stude/schema.yml RUN python stude/manage.py spectacular --color --file stude/schema.yml
# Copy the cronjob file
COPY cronjob /etc/cron.d/cronjob
# Give execution rights on the cron job
RUN chmod 0644 /etc/cron.d/cronjob
# Apply cron job
RUN crontab /etc/cron.d/cronjob
# Create the log file to be able to run tail
RUN touch /var/log/cron.log
# Set editor as VIM
RUN export EDITOR=vim
# Run the command on container startup
CMD cron
# Expose port 8000 for the web server # Expose port 8000 for the web server
EXPOSE 8000 EXPOSE 8000

View file

@ -1,2 +0,0 @@
*/30 * * * * python /code/stude/manage.py clean_old_entries
# An empty line is required at the end of this file for a valid cron file.