Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OERu
wenotes-docker
Commits
16e5be67
Commit
16e5be67
authored
Mar 05, 2018
by
Dave Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding initial support for a cron container, tidying up twitter.js -> twitters.js
parent
5674fe23
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
36 deletions
+38
-36
docker-wenotes-cron/Dockerfile
docker-wenotes-cron/Dockerfile
+26
-0
docker-wenotes-tools/Dockerfile
docker-wenotes-tools/Dockerfile
+9
-9
docker-wenotes-tools/conf/run.sh
docker-wenotes-tools/conf/run.sh
+0
-24
docker-wenotes-tools/conf/services.yml
docker-wenotes-tools/conf/services.yml
+3
-3
No files found.
docker-wenotes-cron/Dockerfile
0 → 100644
View file @
16e5be67
FROM
oeru/wenotes-tools
MAINTAINER
Dave Lane dave@oerfoundation.org - @lightweight and https://tech.oeru.org
# cron is already installed in the base image
# set up cron tasks
RUN
set
-ex
\
&&
{
\
echo
"# created by Docker and the OER Foundation"
;
\
echo
"MAILTO=webmaster@oerfoundation.org"
;
\
echo
"LOG=/var/log/cron.log"
;
\
echo
"WEDIR=/opt/wenotes/tools"
;
\
echo
"PY=/usr/bin/python"
;
\
echo
'8,18,28,38,48,58 * * * * root cd $WEDIR && nice $PY bookmarks.py && nice $PY medium.py'
;
\
echo
'6,16,26,36,46,56 * * * * root cd $WEDIR && nice $PY mastodon.py && nice $PY hypothesis.py'
;
\
echo
'4,14,24,34,44,54 * * * * root cd $WEDIR && nice $PY gplus.py && nice $PY feeds.py && nice $PY groups.py'
;
\
echo
'2,12,22,32,42,52 * * * * root cd $WEDIR && nice $PY forums.py && nice $PY discourse.py --full'
;
\
echo
'*/1 * * * * root echo "Cron ran at $(date)" >> $LOG'
;
\
}
|
tee
/etc/cron.d/wenotes-cron
RUN
chmod
0644 /etc/cron.d/wenotes-cron
RUN
touch
0644 /var/log/cron.log
CMD
cron && tail -f /var/log/cron.log
docker-wenotes-tools/Dockerfile
View file @
16e5be67
...
...
@@ -21,9 +21,9 @@ MAINTAINER Dave Lane dave@oerfoundation.org
# The aim: to make a manageable fully functional dev environment which
# fosters remote API-ification for registering new blog users,
# updating details for session validation, and possibly integrating Mautic...
ENV
APT_SERVER http://ucmirror.canterbury.ac.nz/ubuntu
ENV
APT_FILE sources.list
ENV
UBUNTU_NAME xenial
#
ENV APT_SERVER http://ucmirror.canterbury.ac.nz/ubuntu
#
ENV APT_FILE sources.list
#
ENV UBUNTU_NAME xenial
# subdue the "Dialog" errors...
ENV
DEBIAN_FRONTEND noninteractive
#
...
...
@@ -32,12 +32,12 @@ RUN groupadd -r couchdb && useradd -d /opt/couchdb -g couchdb couchdb
#
# add local mirror to reduce build time :)
RUN
echo
"deb
$APT_SERVER
${
UBUNTU_NAME
}
main universe"
>
/etc/apt/
${
APT_FILE
}
RUN
echo
"deb
$APT_SERVER
${
UBUNTU_NAME
}
-updates main universe"
>>
/etc/apt/
${
APT_FILE
}
RUN
echo
"deb
$APT_SERVER
${
UBUNTU_NAME
}
-security main universe"
>>
/etc/apt/
${
APT_FILE
}
RUN
echo
"deb-src
$APT_SERVER
${
UBUNTU_NAME
}
main universe"
>>
/etc/apt/
${
APT_FILE
}
RUN
echo
"deb-src
$APT_SERVER
${
UBUNTU_NAME
}
-updates main universe"
>>
/etc/apt/
${
APT_FILE
}
RUN
echo
"deb-src
$APT_SERVER
${
UBUNTU_NAME
}
-security main universe"
>>
/etc/apt/
${
APT_FILE
}
#
RUN echo "deb $APT_SERVER ${UBUNTU_NAME} main universe" > /etc/apt/${APT_FILE}
#
RUN echo "deb $APT_SERVER ${UBUNTU_NAME}-updates main universe" >> /etc/apt/${APT_FILE}
#
RUN echo "deb $APT_SERVER ${UBUNTU_NAME}-security main universe" >> /etc/apt/${APT_FILE}
#
RUN echo "deb-src $APT_SERVER ${UBUNTU_NAME} main universe" >> /etc/apt/${APT_FILE}
#
RUN echo "deb-src $APT_SERVER ${UBUNTU_NAME}-updates main universe" >> /etc/apt/${APT_FILE}
#
RUN echo "deb-src $APT_SERVER ${UBUNTU_NAME}-security main universe" >> /etc/apt/${APT_FILE}
# do one update and start installing...
RUN
apt-get update
-y
&&
apt-get
install
-y
--no-install-recommends
\
apt-transport-https
\
...
...
docker-wenotes-tools/conf/run.sh
View file @
16e5be67
...
...
@@ -14,7 +14,6 @@ GIT=`which git`
NPM
=
`
which npm
`
PM2
=
`
which pm2
`
CP
=
`
which
cp
`
CRON
=
/etc/cron.d/wenotes
echo
"CWD=
$CWD
, GIT=
$GIT
"
...
...
@@ -35,15 +34,6 @@ 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"
...
...
@@ -68,20 +58,6 @@ else
fi
# set up options.json
# set up Cron jobs...
echo
"setting up cron jobs"
echo
"# created by Docker and the OER Foundation"
>
$CRON
echo
"MAILTO=webmaster@oerfoundation.org"
>>
$CRON
echo
"LOG=/opt/wenotes/logs/crontest"
>>
$CRON
echo
"WEDIR=/opt/wenotes/tools"
>>
$CRON
echo
"PY=/usr/bin/python"
>>
$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
echo
'2,12,22,32,42,52 * * * * root cd $WEDIR && nice $PY forums.py && nice $PY discourse.py --full'
>>
$CRON
echo
'*/1 * * * * root echo "Cron ran at $(date)" >> $LOG'
>>
$CRON
chmod
0644
$CRON
# next start various Javascript services
if
[[
-f
$CONF
/services.yml
]]
;
then
cd
$WENOTES
/tools
...
...
docker-wenotes-tools/conf/services.yml
View file @
16e5be67
...
...
@@ -5,10 +5,10 @@ apps:
name
:
'
CouchWatch'
merge_logs
:
true
out_file
:
'
/tmp/couchwatch.log'
-
script
:
'
twitter.js'
name
:
'
Twitter
Watcher'
-
script
:
'
twitter
s
.js'
name
:
'
Twitter
Stream
Watcher'
merge_logs
:
true
out_file
:
'
/tmp/twitter.log'
out_file
:
'
/tmp/twitter
s
.log'
-
script
:
'
irc.js'
name
:
'
IRC
Watcher'
merge_logs
:
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment