2017-03-28 16:48:44 -07:00
|
|
|
FROM ubuntu:xenial
|
2015-06-23 00:24:41 -07:00
|
|
|
|
2017-01-01 19:42:01 -08:00
|
|
|
ENTRYPOINT ["/usr/local/bin/pyircbot"]
|
2017-01-01 19:30:36 -08:00
|
|
|
WORKDIR /srv/bot/
|
2017-01-01 19:36:56 -08:00
|
|
|
CMD ["-c", "config.json"]
|
2015-12-13 14:12:21 -08:00
|
|
|
|
2017-01-01 19:30:36 -08:00
|
|
|
RUN useradd bot ; \
|
|
|
|
sed -i -e 's/archive.ubuntu.com/mirrors.digitalocean.com/' /etc/apt/sources.list ; \
|
2015-12-13 14:12:21 -08:00
|
|
|
apt-get update ; \
|
2017-01-01 19:30:36 -08:00
|
|
|
apt-get install -y python3 python3-setuptools python3-requests curl unzip sqlite3 ; \
|
2015-09-14 21:41:26 -07:00
|
|
|
easy_install3 pip ; \
|
2015-06-23 00:24:41 -07:00
|
|
|
pip3 install praw pytz ; \
|
2015-11-01 18:16:34 -08:00
|
|
|
curl -o /tmp/bitcoinrpc.zip https://codeload.github.com/dpedu/python-bitcoinrpc/zip/master ; \
|
|
|
|
unzip bitcoinrpc.zip ; \
|
|
|
|
cd python-bitcoinrpc-master ; \
|
|
|
|
python3 setup.py install ; \
|
2015-06-23 00:24:41 -07:00
|
|
|
useradd bot ; \
|
|
|
|
mkdir /srv/bot ; \
|
|
|
|
chown bot /srv/bot ; \
|
2015-12-13 14:12:21 -08:00
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/bitcoinrpc.zip /tmp/python-bitcoinrpc-master
|
2015-06-23 00:24:41 -07:00
|
|
|
|
2015-12-13 14:12:21 -08:00
|
|
|
COPY . /tmp/pyircbot/
|
2015-06-23 00:24:41 -07:00
|
|
|
|
2015-12-13 14:12:21 -08:00
|
|
|
RUN cd /tmp/pyircbot/ ; \
|
|
|
|
python3 setup.py install ; \
|
|
|
|
su -c "cp -r /tmp/pyircbot/examples/config.json /tmp/pyircbot/examples/data/ /srv/bot/" bot ; \
|
|
|
|
cd / ; \
|
|
|
|
rm -rf /tmp/pyircbot
|
2017-01-01 19:30:36 -08:00
|
|
|
|
|
|
|
USER bot
|