Dockerfile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. FROM alpine:3.12
  2. ARG TARGETARCH=amd64
  3. RUN echo $'\
  4. @edge http://dl-cdn.alpinelinux.org/alpine/edge/main\n\
  5. @edge http://dl-cdn.alpinelinux.org/alpine/edge/testing\n\
  6. @edge http://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories
  7. RUN apk add --no-cache \
  8. python3 py3-pip py3-setuptools py3-wheel \
  9. py3-virtualenv \
  10. py3-pillow \
  11. py3-aiohttp \
  12. py3-magic \
  13. py3-ruamel.yaml \
  14. py3-commonmark@edge \
  15. # Other dependencies
  16. ca-certificates \
  17. su-exec \
  18. # encryption
  19. olm-dev \
  20. py3-cffi \
  21. py3-pycryptodome \
  22. py3-unpaddedbase64 \
  23. py3-future \
  24. bash \
  25. curl \
  26. jq && \
  27. curl -sLo yq https://github.com/mikefarah/yq/releases/download/3.3.2/yq_linux_${TARGETARCH} && \
  28. chmod +x yq && mv yq /usr/bin/yq
  29. COPY requirements.txt /opt/mautrix-signal/requirements.txt
  30. COPY optional-requirements.txt /opt/mautrix-signal/optional-requirements.txt
  31. WORKDIR /opt/mautrix-signal
  32. RUN apk add --virtual .build-deps python3-dev libffi-dev build-base \
  33. && pip3 install -r requirements.txt -r optional-requirements.txt \
  34. && apk del .build-deps
  35. COPY . /opt/mautrix-signal
  36. RUN apk add git && pip3 install .[all] && apk del git \
  37. # This doesn't make the image smaller, but it's needed so that the `version` command works properly
  38. && cp mautrix_signal/example-config.yaml . && rm -rf mautrix_signal
  39. VOLUME /data
  40. ENV UID=1337 GID=1337
  41. CMD ["/opt/mautrix-signal/docker-run.sh"]