pyircbot/examples/docker/Dockerfile

27 lines
734 B
Docker
Raw Normal View History

2018-04-12 16:20:14 -07:00
FROM ubuntu:bionic
2015-06-23 00:24:41 -07:00
2017-01-01 19:42:01 -08:00
ENTRYPOINT ["/usr/local/bin/pyircbot"]
WORKDIR /srv/bot/
2017-01-01 19:36:56 -08:00
CMD ["-c", "config.json"]
2018-04-12 16:20:14 -07:00
ADD requirements.txt /tmp/requirements.txt
2017-09-21 21:09:35 -07:00
RUN apt-get update && \
2018-04-12 16:20:14 -07:00
apt-get install -y python3 python3-setuptools python3-pip sqlite3 git && \
pip3 install -r /tmp/requirements.txt && \
2017-07-02 16:22:24 -07:00
useradd --home-dir /srv/bot bot && \
chown bot /srv/bot && \
2018-04-12 16:20:14 -07:00
apt-get remove -y python3-pip perl && \
apt-get autoremove -y && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
2015-06-23 00:24:41 -07:00
COPY . /tmp/pyircbot/
2015-06-23 00:24:41 -07:00
2017-07-02 16:22:24 -07: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
USER bot