Add cron jobs for django-cas-server

This commit is contained in:
Livvy Mackintosh 2017-05-23 01:13:43 +02:00
parent 2ebc58d026
commit cce1588f75
2 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,7 @@ SHELL ["/bin/bash","-ex","-c"]
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y\
build-essential\
cron\
locales\
libgdal-dev\
libpq-dev\
@ -53,6 +54,9 @@ RUN python3 -m pip install -r requirements.txt
# APP
WORKDIR /app
COPY . .
COPY ./support/cron/* /etc/cron.d/
RUN chmod 0644 /etc/cron.d/*\
&& touch /var/log/cron.log
EXPOSE 8000

3
support/cron/django-cas Normal file
View File

@ -0,0 +1,3 @@
0 0 * * * cas-user /app/manage.py clearsessions
*/5 * * * * cas-user /app/manage.py cas_clean_tickets
5 0 * * * cas-user /app/manage.py cas_clean_sessions