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 \
RUN apt-get update \
&& apt-get -qq -y install \
cmake \
git \ git \
python-atomicwrites \ libolm-dev \
python-attr \ python3 \
python-future \ python3-pip \
python-h2 \ weechat-curses \
python-jsonschema \
python-logbook \
python-openssl \
python-peewee \
python-pip \
python-pygments \
python-typing \
python-unpaddedbase64 \
python-webcolors \
python-wheel \
weechat \
weechat-python \ weechat-python \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& pip install h11 \ && rm -fr /root/.cache
&& rm -rf /root/.cache
WORKDIR /root # add chat user
RUN git clone https://git.matrix.org/git/olm.git \ RUN useradd -ms /bin/bash chat && mkdir /var/build
&& cd olm \
&& cmake . \ # get and build source code
&& make install \ WORKDIR /var/build
&& ldconfig RUN git clone https://github.com/poljar/weechat-matrix.git
RUN pip install 'git+https://github.com/poljar/python-olm.git@master#egg=python-olm-0' WORKDIR /var/build/weechat-matrix
RUN git clone https://github.com/poljar/matrix-nio \ RUN pip3 install -r requirements.txt
&& cd matrix-nio \
&& DESTDIR=/ make install # Install and setup autoloading
RUN git clone https://github.com/poljar/weechat-matrix \ USER chat
&& cd weechat-matrix \ RUN make install
&& make install WORKDIR /home/chat
RUN mkdir -p .weechat/python/autoload && ln -s /home/chat/.weechat/python/matrix.py /home/chat/.weechat/python/autoload/