2021-02-23 07:08:17 -05:00
|
|
|
ARG PYTHON_VERSION=3.9
|
2021-02-11 12:15:24 -05:00
|
|
|
|
|
|
|
FROM docker.io/python:${PYTHON_VERSION}-slim as builder
|
|
|
|
|
|
|
|
# install the OS build deps
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
build-essential \
|
|
|
|
libffi-dev \
|
|
|
|
libjpeg-dev \
|
|
|
|
libpq-dev \
|
|
|
|
libssl-dev \
|
|
|
|
libwebp-dev \
|
|
|
|
libxml++2.6-dev \
|
|
|
|
libxslt1-dev \
|
|
|
|
zlib1g-dev \
|
2021-03-26 08:28:12 -04:00
|
|
|
openssl \
|
2021-02-11 12:15:24 -05:00
|
|
|
git \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
# Build dependencies that are not available as wheels, to speed up rebuilds
|
|
|
|
RUN pip install --prefix="/install" --no-warn-script-location \
|
2021-12-21 12:49:28 -05:00
|
|
|
"frozendict<2.1.2" \
|
2021-02-11 12:15:24 -05:00
|
|
|
jaeger-client \
|
|
|
|
opentracing \
|
|
|
|
# Match the version constraints of Synapse
|
2022-02-01 07:22:34 -05:00
|
|
|
"prometheus_client>=0.4.0,<0.13.0" \
|
2021-02-11 12:15:24 -05:00
|
|
|
psycopg2 \
|
|
|
|
pycparser \
|
|
|
|
pyrsistent \
|
|
|
|
pyyaml \
|
|
|
|
simplejson \
|
|
|
|
threadloop \
|
|
|
|
thrift
|
|
|
|
|
|
|
|
# now install synapse and all of the python deps to /install.
|
|
|
|
COPY synapse /synapse/synapse/
|
|
|
|
COPY scripts /synapse/scripts/
|
|
|
|
COPY MANIFEST.in README.rst setup.py synctl /synapse/
|
|
|
|
|
|
|
|
RUN pip install --prefix="/install" --no-warn-script-location \
|
|
|
|
/synapse[all] \
|
|
|
|
'git+https://github.com/maunium/synapse-simple-antispam#egg=synapse-simple-antispam' \
|
2021-11-09 09:08:32 -05:00
|
|
|
'git+https://github.com/devture/matrix-synapse-shared-secret-auth@e178353ec87c56e0169dd04466d4769da5ed9c46#egg=shared_secret_authenticator'
|
2021-02-11 12:15:24 -05:00
|
|
|
|
|
|
|
FROM docker.io/python:${PYTHON_VERSION}-slim
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
curl \
|
|
|
|
gosu \
|
|
|
|
libjpeg62-turbo \
|
|
|
|
libpq5 \
|
|
|
|
libwebp6 \
|
|
|
|
xmlsec1 \
|
|
|
|
libjemalloc2 \
|
2021-03-26 08:28:12 -04:00
|
|
|
openssl \
|
2021-02-11 12:15:24 -05:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
COPY --from=builder /install /usr/local
|
2020-11-17 18:12:41 -05:00
|
|
|
|
|
|
|
VOLUME ["/data"]
|
|
|
|
ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libjemalloc.so.2"
|
|
|
|
|
|
|
|
ENTRYPOINT ["python3", "-m", "synapse.app.homeserver"]
|
|
|
|
CMD ["--keys-directory", "/data", "-c", "/data/homeserver.yaml"]
|
2021-02-11 12:15:24 -05:00
|
|
|
|
|
|
|
HEALTHCHECK --interval=1m --timeout=5s \
|
|
|
|
CMD curl -fSs http://localhost:8008/health || exit 1
|