2015-06-23 00:24:41 -07:00
|
|
|
FROM ubuntu:trusty
|
|
|
|
|
|
|
|
RUN apt-get update ; \
|
2015-11-01 18:05:04 -08:00
|
|
|
apt-get install -y python3 python3-setuptools python3-requests curl sqlite3 supervisor ; \
|
2015-09-14 21:41:26 -07:00
|
|
|
easy_install3 pip ; \
|
2015-06-23 00:24:41 -07:00
|
|
|
pip3 install praw pytz ; \
|
|
|
|
useradd bot ; \
|
|
|
|
cd /tmp ; \
|
2015-09-14 21:45:55 -07:00
|
|
|
mkdir pyircbot3.git ; \
|
|
|
|
curl http://gitlab.xmopx.net/dave/pyircbot3/repository/archive.tar.gz | tar zxvf - -C pyircbot3.git --strip-components=1 ; \
|
2015-06-23 00:24:41 -07:00
|
|
|
cd pyircbot3.git/ ; \
|
|
|
|
python3 setup.py install ; \
|
|
|
|
mkdir /srv/bot ; \
|
|
|
|
chown bot /srv/bot ; \
|
|
|
|
echo "[supervisord]" > /etc/supervisor/conf.d/supervisor.conf ; \
|
|
|
|
echo "nodaemon=true" >> /etc/supervisor/conf.d/supervisor.conf ; \
|
2015-09-14 21:41:26 -07:00
|
|
|
su -c "cp -r /tmp/pyircbot3.git/examples/config.json /tmp/pyircbot3.git/examples/data/ /srv/bot/" bot ; \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2015-06-23 00:24:41 -07:00
|
|
|
|
|
|
|
ADD pyircbot.conf /etc/supervisor/conf.d/pyircbot.conf
|
|
|
|
|
2015-08-30 23:22:54 -07:00
|
|
|
CMD ["supervisord"]
|