Upgrade Dockerfile to python3

This fixes #124

This moves to installing dependencies from pip instead of system
packages, it moves the base docker image forward a release, and sets
weechat to run as a user instead of root.
This commit is contained in:
Spencer Krum 2020-01-12 01:30:01 -06:00
parent c1b8fe97c3
commit 73ada3e3b9

View file

@ -1,43 +1,28 @@
FROM debian:buster-slim FROM debian:testing-slim
ENV DEBIAN_FRONTEND="noninteractive" \ RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
LANG="C.UTF-8" RUN apt-get update -y; apt-get install -q -y \
git \
libolm-dev \
python3 \
python3-pip \
weechat-curses \
weechat-python \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -fr /root/.cache
RUN apt-get update \ # add chat user
&& apt-get -qq -y install \ RUN useradd -ms /bin/bash chat && mkdir /var/build
cmake \
git \
python-atomicwrites \
python-attr \
python-future \
python-h2 \
python-jsonschema \
python-logbook \
python-openssl \
python-peewee \
python-pip \
python-pygments \
python-typing \
python-unpaddedbase64 \
python-webcolors \
python-wheel \
weechat \
weechat-python \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& pip install h11 \
&& rm -rf /root/.cache
WORKDIR /root # get and build source code
RUN git clone https://git.matrix.org/git/olm.git \ WORKDIR /var/build
&& cd olm \ RUN git clone https://github.com/poljar/weechat-matrix.git
&& cmake . \ WORKDIR /var/build/weechat-matrix
&& make install \ RUN pip3 install -r requirements.txt
&& ldconfig
RUN pip install 'git+https://github.com/poljar/python-olm.git@master#egg=python-olm-0' # Install and setup autoloading
RUN git clone https://github.com/poljar/matrix-nio \ USER chat
&& cd matrix-nio \ RUN make install
&& DESTDIR=/ make install WORKDIR /home/chat
RUN git clone https://github.com/poljar/weechat-matrix \ RUN mkdir -p .weechat/python/autoload && ln -s /home/chat/.weechat/python/matrix.py /home/chat/.weechat/python/autoload/
&& cd weechat-matrix \
&& make install