mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2024-11-17 06:19:24 +08:00
Remove container cron job and move cron job to main server instead
This commit is contained in:
parent
0429d7cd25
commit
ef8ac8c28c
2 changed files with 0 additions and 21 deletions
19
Dockerfile
19
Dockerfile
|
@ -18,7 +18,6 @@ RUN apt-get update && apt-get install -y \
|
|||
libspatialite-dev \
|
||||
gdal-bin \
|
||||
libsqlite3-mod-spatialite \
|
||||
cron \
|
||||
vim
|
||||
|
||||
# Create directory
|
||||
|
@ -42,23 +41,5 @@ RUN python stude/manage.py custom_migrate
|
|||
# Generate DRF Spectacular Documentation
|
||||
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 8000
|
||||
|
|
2
cronjob
2
cronjob
|
@ -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.
|
Loading…
Reference in a new issue