-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
157 lines (148 loc) · 6.4 KB
/
Containerfile
File metadata and controls
157 lines (148 loc) · 6.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# SPDX-FileCopyrightText: © 2026 Nfrastack <code@nfrastack.com>
#
# SPDX-License-Identifier: MIT
ARG \
BASE_IMAGE
FROM ${BASE_IMAGE}
LABEL \
org.opencontainers.image.title="Synapse" \
org.opencontainers.image.description="Matrix Homeserver" \
org.opencontainers.image.url="https://hub.docker.com/r/nfrastack/synapse" \
org.opencontainers.image.documentation="https://github.com/nfrastack/container-synapse/blob/main/README.md" \
org.opencontainers.image.source="https://github.com/nfrastack/container-synapse.git" \
org.opencontainers.image.authors="Nfrastack <code@nfrastack.com>" \
org.opencontainers.image.vendor="Nfrastack <https://www.nfrastack.com>" \
org.opencontainers.image.licenses="MIT"
ARG \
SYNAPSE_VERSION="v1.151.0" \
PROVIDDER_LDAP_VERSION="v0.4.0" \
PROVIDER_SHARED_SECRET_VERSION="2.0.3" \
SYNAPSE_REPO_URL="https://github.com/element-hq/synapse" \
PROVIDER_LDAP_REPO_URL="https://github.com/matrix-org/matrix-synapse-ldap3" \
PROVIDER_SHARED_SECRET_REPO_URL="https://github.com/devture/matrix-synapse-shared-secret-auth"
COPY CHANGELOG.md /usr/src/container/CHANGELOG.md
COPY LICENSE /usr/src/container/LICENSE
COPY README.md /usr/src/container/README.md
ENV \
CONTAINER_ENABLE_SCHEDULING=TRUE \
IMAGE_NAME="nfrastack/synapse" \
IMAGE_REPO_URL="https://github.com/nfrastack/container-synapse/"
RUN echo "" && \
SYNAPSE_BUILD_DEPS_ALPINE=" \
g++ \
py3-gpep517 \
py3-installer \
py3-poetry-core \
py3-pip \
py3-setuptools-rust \
py3-wheel \
python3-dev \
libpq-dev \
" \
&& \
\
SYNAPSE_RUN_DEPS_ALPINE=" \
inotify-tools \
libpq \
postgresql-client \
python3 \
py3-asn1 \
py3-asn1-modules \
py3-attrs \
py3-authlib \
py3-boto3 \
py3-botocore \
py3-bcrypt \
py3-bleach \
py3-canonicaljson \
py3-daemonize \
py3-eliot \
py3-frozendict \
py3-humanize \
py3-idna \
py3-ijson \
py3-jinja2 \
py3-jsonschema \
py3-jwt \
py3-ldap3 \
py3-lxml \
py3-maturin \
py3-matrix-common \
py3-msgpack \
py3-netaddr \
py3-openssl \
py3-phonenumbers \
py3-pillow \
py3-prometheus-client \
py3-psycopg2 \
py3-pydantic \
py3-pymacaroons \
py3-pynacl \
#py3-saml2 \
py3-service_identity \
py3-setuptools-rust \
py3-signedjson \
py3-sortedcontainers \
py3-treq \
py3-tqdm \
py3-twisted \
#py3-txacme \
py3-txredisapi \
py3-typing-extensions \
py3-yaml \
sed \
sqlite \
" \
&& \
source /container/base/functions/container/build && \
container_build_log image && \
create_user synapse 8008 synapse 8008 /dev/null && \
package update && \
package upgrade && \
package install \
SYNAPSE_BUILD_DEPS \
SYNAPSE_RUN_DEPS \
&& \
package build go && \
package build yq && \
\
clone_git_repo "${SYNAPSE_REPO_URL}" "${SYNAPSE_VERSION}" && \
cd /usr/src/synapse && \
gpep517 build-wheel \
--wheel-dir dist \
--output-fd 1 \
&& \
pip install \
--break-system-packages \
--root-user-action ignore \
--upgrade dist/*.whl && \
mkdir -p \
/container/data/synapse \
/var/run/synapse \
&& \
echo "${SYNAPSE_VERSION}" > /var/run/synapse/version && \
cp -R /usr/src/synapse/synapse/res/* /container/data/synapse && \
chown -R synapse:synapse \
/container/data/synapse \
/var/run/synapse \
&& \
container_build_log add "Synapse" "${SYNAPSE_VERSION}" "${SYNAPSE_REPO_URL}" && \
\
clone_git_repo "${PROVIDER_LDAP_REPO_URL}" "${PROVIDER_LDAP_VERSION}" && \
gpep517 build-wheel \
--wheel-dir dist \
--output-fd 1 \
&& \
pip install --break-system-packages --upgrade dist/*.whl && \
container_build_log add "Synapse LDAP Authentication Provider" "${PROVIDDER_LDAP_VERSION}" "${PROVIDER_LDAP_REPO_URL}" && \
\
clone_git_repo "${PROVIDER_SHARED_SECRET_REPO_URL}" "${PROVIDER_SHARED_SECRET_VERSION}" && \
cp -R shared_secret_authenticator.py /usr/lib/python*/ && \
container_build_log add "Synapse Shared Secret provider" "${PROVIDER_SHARED_SECRET_VERSION}" "${PROVIDER_SHARED_SECRET_REPO_URL}" && \
\
package remove \
SYNAPSE_BUILD_DEPS \
&& \
package cleanup
EXPOSE 8008
COPY rootfs /