matrix-bridge-telegram/Dockerfile

97 lines
1.7 KiB
Docker

FROM alpine:3.15 as builder
ENV VERSION=0.11.3
RUN apk --no-cache add \
sed \
gcc \
g++ \
git \
musl-dev \
libffi-dev \
python3-dev \
py3-pip \
py3-wheel \
py3-brotli \
py3-olm \
py3-qrcode \
py3-pillow \
py3-phonenumbers \
py3-unpaddedbase64 \
py3-pycryptodome \
py3-pyaes \
py3-rsa \
py3-cparser \
py3-cffi \
py3-decorator \
py3-tqdm \
py3-numpy \
py3-future \
py3-asn1 \
py3-ruamel.yaml \
py3-magic \
py3-commonmark \
py3-aiohttp \
py3-yarl \
py3-mako \
py3-setuptools
RUN git clone -b v0.25.0 --recursive https://github.com/MagicStack/asyncpg.git
WORKDIR /asyncpg
RUN sed -ie '1,3d' pyproject.toml
RUN python3 setup.py install --prefix=/install
RUN pip3 install --prefix=/install mautrix-telegram[all]==$VERSION
FROM thallian/confd-env:latest
ENV FFMPEG_BINARY=/usr/bin/ffmpeg
COPY --from=builder /install /py-pkgs
RUN addgroup -g 2222 matrix-bridge
RUN adduser -h /var/lib/matrix-bridge -u 2222 -D -G matrix-bridge matrix-bridge
RUN apk --no-cache add \
ca-certificates \
ffmpeg \
libffi \
python3 \
py3-brotli \
py3-olm \
py3-qrcode \
py3-pillow \
py3-phonenumbers \
py3-unpaddedbase64 \
py3-pycryptodome \
py3-pyaes \
py3-rsa \
py3-cparser \
py3-cffi \
py3-decorator \
py3-tqdm \
py3-numpy \
py3-future \
py3-asn1 \
py3-ruamel.yaml \
py3-magic \
py3-commonmark \
py3-aiohttp \
py3-yarl \
py3-mako \
py3-setuptools
ENV PYTHONPATH=/usr/lib/python3.9/site-packages:/py-pkgs/lib/python3.9/site-packages/
WORKDIR /var/lib/matrix-bridge
RUN mkdir /var/lib/matrix-bridge/data
ADD /rootfs /
RUN chown -R matrix-bridge:matrix-bridge /var/lib/matrix-bridge
ENV HOME /var/lib/matrix-bridge
EXPOSE 8080