Commit 84ebc1da authored by Dave Lane's avatar Dave Lane

added msmtp, updated Dockerfile and run.sh

parent f96d3986
......@@ -59,10 +59,12 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
python-couchdb \
python-feedparser \
python-html5lib \
python-httplib2 \
python-lxml \
python-lxml \
python-pip \
python-urllib3 \
rsyslog
python-requests \
python-urllib3
# grab gosu for easy step-down from root and tini for signal handling
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
......@@ -78,6 +80,12 @@ RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364
&& rm /usr/local/bin/tini.asc \
&& chmod +x /usr/local/bin/tini
# install cron and msmtp for outgoing email
RUN apt-get install -y cron msmtp rsyslog
# install useful tools
RUN apt-get install -y less net-tools vim
# install Node.JS repos and do another update...
RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
&& echo 'deb https://deb.nodesource.com/node_4.x trusty main' > /etc/apt/sources.list.d/nodesource.list \
......@@ -114,10 +122,8 @@ COPY ./conf /root/conf/
#Prepare the main install script
RUN chmod u+x /root/conf/*.sh
# expose relevant ports
VOLUME ["/opt/wenotes/tools"]
VOLUME ["/opt/wenotes/logs"]
VOLUME ["/opt/wenotes/tools/options.json"]
# expose relevant volumes
VOLUME ["/opt/wenotes/tools", "/opt/wenotes/logs", "/opt/wenotes/tools/options.json", "/opt/wenotes/tools/msmtprc"]
# First, say we're doing it
RUN echo "running run.sh - /root/conf/run.sh"
......
......@@ -35,6 +35,22 @@ fi
echo "starting services"
# start rsyslogd
echo "restarting rsyslog"
service rsyslog restart
echo `service rsyslog status`
# restart cron
echo "restarting cron"
service cron restart
echo `service cron status`
# remove default msmtprc
if [[ -f /opt/wenotes/tools/msmtprc ]] ; then
echo "moving our msmtprc to /etc and /etc/msmtprc to /etc/msmtprc.default"
mv /etc/msmtprc /etc/msmtprc.default
cp /opt/wenotes/tools/msmtprc /etc/msmtprc
fi
# next, get the Javascript code:
# get the repo
echo "moving to $WENOTES"
......@@ -55,9 +71,12 @@ fi
# set up Cron jobs...
echo "setting up cron jobs"
echo "# created by Docker and the OER Foundation" > $CRON
echo "LOG=/opt/wenotes/cronttest" >> $CRON
echo "MAILTO=webmaster@oerfoundation.org" >> $CRON
echo "LOG=/opt/wenotes/logs/cronttest" >> $CRON
echo "WEDIR=/opt/wenotes/tools" >> $CRON
echo "PY=/usr/bin/python"
echo "PY=/usr/bin/python" >> $CRON
echo "TIME=`date`" >> $CRON
echo '*/1 * * * * root echo "Cron ran at $TIME" >> $LOG' >> $CRON
echo '8,18,28,38,48,58 * * * * root cd $WEDIR && nice $PY bookmarks.py && nice $PY medium.py' >> $CRON
echo '6,16,26,36,46,56 * * * * root cd $WEDIR && nice $PY mastodon.py && nice $PY hypothesis.py' >> $CRON
echo '4,14,24,34,44,54 * * * * root cd $WEDIR && nice $PY gplus.py && nice $PY feeds.py && nice $PY groups.py' >> $CRON
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment