matrix-bridge-telegram/Dockerfile
2021-06-28 13:57:32 +00:00

98 lines
2.1 KiB
Docker

FROM alpine:3.14 as builder
ENV VERSION=730f6bab6fc0ca4077f3b09d866ad50767df9086
RUN apk --no-cache add \
gcc \
g++ \
musl-dev \
python3-dev \
zlib-dev \
jpeg-dev \
libffi-dev \
postgresql-dev \
py3-pip \
py3-aiohttp \
py3-sqlalchemy \
py3-magic \
py3-lxml \
py3-attrs \
py3-chardet \
py3-multidict \
py3-yarl \
py3-idna-ssl \
py3-mako \
py3-dateutil \
py3-future \
py3-async-timeout \
py3-rsa \
py3-decorator \
py3-idna \
py3-markupsafe \
py3-six \
py3-asn1 \
py3-numpy \
py3-psycopg2 \
py3-wheel \
olm-dev
RUN mkdir /tmp/mautrix-telegram
RUN wget -qO- https://github.com/tulir/mautrix-telegram/archive/$VERSION.tar.gz | tar -xz --strip 1 -C /tmp/mautrix-telegram
RUN cd /tmp/mautrix-telegram && pip3 install -r requirements.txt -r optional-requirements.txt && pip3 install .
FROM thallian/confd-env:latest
ENV FFMPEG_BINARY=/usr/bin/ffmpeg
RUN addgroup -g 2222 matrix-bridge
RUN adduser -h /var/lib/matrix-bridge -u 2222 -D -G matrix-bridge matrix-bridge
COPY --from=builder /usr/lib/python3.9/site-packages /usr/lib/python3.8/site-packages
COPY --from=builder /usr/bin/alembic /usr/bin/alembic
COPY --from=builder /tmp/mautrix-telegram/alembic /var/lib/matrix-bridge/alembic
COPY --from=builder /tmp/mautrix-telegram/alembic.ini /var/lib/matrix-bridge/alembic.ini
RUN apk --no-cache add \
ca-certificates \
python3 \
ffmpeg \
libmagic \
zlib \
jpeg \
libffi \
postgresql-dev \
py3-aiohttp \
py3-sqlalchemy \
py3-magic \
py3-lxml \
py3-attrs \
py3-chardet \
py3-multidict \
py3-yarl \
py3-idna-ssl \
py3-mako \
py3-dateutil \
py3-future \
py3-async-timeout \
py3-rsa \
py3-decorator \
py3-idna \
py3-markupsafe \
py3-six \
py3-asn1 \
py3-numpy \
py3-psycopg2 \
olm
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