[odrs-web/oscp] Land a cronjob for the daily ratings stats



commit e695bcbe9db2e675e5d6159c5a4b8f9ff94b56f1
Author: Andrea Veri <averi redhat com>
Date:   Wed Nov 14 11:39:41 2018 +0100

    Land a cronjob for the daily ratings stats

 Dockerfile | 5 ++++-
 odrs.cron  | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/Dockerfile b/Dockerfile
index ce3c968..97a16b5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,7 +3,7 @@ FROM centos/httpd-24-centos7
 USER root 
 
 RUN yum update -y
-RUN yum install gcc make python27-python python27-python-pip python27-mod_wsgi python27-python-devel 
python2-cryptography python-flask python2-flask-wtf python2-flask-login python2-PyMySQL mariadb -y
+RUN yum install gcc make python27-python python27-python-pip python27-mod_wsgi python27-python-devel 
python2-cryptography python-flask python2-flask-wtf python2-flask-login python2-PyMySQL crontab -y
 
 ENV ODRS_HOME=/opt/app-root/src \
     LANG=C
@@ -15,6 +15,9 @@ COPY app_data ${ODRS_HOME}
 COPY odrs.gnome.org.conf /etc/httpd/conf.d/odrs.gnome.org.conf
 RUN rm /etc/httpd/conf.d/welcome.conf
 
+RUN python /opt/app-root/src/cron.py ratings /opt/app-root/src/ratings.json 
+COPY odrs.cron /etc/cron.d/odrs
+
 RUN chown -R 1000310000:0 ${ODRS_HOME} && \
     chmod -R 664 ${ODRS_HOME} && \
     find ${ODRS_HOME} -type d -exec chmod 775 {} +
diff --git a/odrs.cron b/odrs.cron
new file mode 100644
index 0000000..720c209
--- /dev/null
+++ b/odrs.cron
@@ -0,0 +1 @@
+59 23 * * * python /opt/app-root/src/cron.py ratings /opt/app-root/src/ratings.json


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]