forked from AVENTER-UG/docker-matrix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
111 lines (102 loc) · 3.03 KB
/
Dockerfile
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
# target architecture
ARG BASE_ARCH=${ARCH:-amd64}
FROM ${BASE_ARCH}/debian:buster-slim
# Maintainer
MAINTAINER Andreas Peters <[email protected]>
# install homerserver template
COPY adds/start.sh /start.sh
# startup configuration
ENTRYPOINT ["/start.sh"]
CMD ["autostart"]
EXPOSE 8448
VOLUME ["/data"]
# Git branch to build from
ARG BV_SYN=release-v1.27.0
ARG BV_TUR=master
ARG TAG_SYN=v1.27.0
# user configuration
ENV MATRIX_UID=991 MATRIX_GID=991
# use --build-arg REBUILD=$(date) to invalidate the cache and upgrade all
# packages
ARG REBUILD=1
RUN set -ex \
&& export ARCH=`dpkg --print-architecture` \
&& export MARCH=`uname -m` \
&& mkdir /uploads \
&& export DEBIAN_FRONTEND=noninteractive \
&& mkdir -p /var/cache/apt/archives \
&& touch /var/cache/apt/archives/lock \
&& apt-get clean \
&& apt-get update -y -q --fix-missing\
&& apt-get upgrade -y \
&& buildDeps=" \
rustc \
cargo \
file \
gcc \
git \
libevent-dev \
libffi-dev \
libgnutls28-dev \
libjpeg62-turbo-dev \
libldap2-dev \
libsasl2-dev \
libsqlite3-dev \
libssl-dev \
libtool \
libxml2-dev \
libxslt1-dev \
make \
zlib1g-dev \
python3-dev \
python3-setuptools \
libpq-dev \
" \
&& apt-get install -y --no-install-recommends \
$buildDeps \
bash \
coreutils \
coturn \
libffi6 \
libjpeg62-turbo \
libssl1.1 \
libtool \
libxml2 \
libxslt1.1 \
pwgen \
python3 \
python3-pip \
python3-jinja2 \
sqlite \
zlib1g \
; \
pip3 install --upgrade wheel ;\
pip3 install --upgrade psycopg2;\
pip3 install --upgrade python-ldap ;\
pip3 install --upgrade twisted==20.3.0 ;\
pip3 install --upgrade redis ;\
pip3 install -e "git+https://github.com/t2bot/synapse-simple-antispam#egg=synapse-simple-antispam" ;\
pip3 install -e "git+https://github.com/matrix-org/mjolnir.git#egg=mjolnir&subdirectory=synapse_antispam" ;\
pip3 install --upgrade lxml \
; \
groupadd -r -g $MATRIX_GID matrix \
&& useradd -r -d /data -M -u $MATRIX_UID -g matrix matrix \
&& chown -R $MATRIX_UID:$MATRIX_GID /data \
&& chown -R $MATRIX_UID:$MATRIX_GID /uploads \
&& git clone --branch $BV_SYN --depth 1 https://github.com/matrix-org/synapse.git \
&& cd /synapse \
&& git checkout -b tags/$TAG_SYN \
&& pip3 install --upgrade .[all] \
&& GIT_SYN=$(git ls-remote https://github.com/matrix-org/synapse $BV_SYN | cut -f 1) \
&& echo "synapse: $BV_SYN ($GIT_SYN)" >> /synapse.version \
&& cd / \
&& rm -rf /synapse \
; \
apt-get autoremove -y $buildDeps ; \
apt-get autoremove -y ;\
ln -s /usr/lib/${MARCH}-linux-gnu/libjemalloc.so.2 /usr/lib/libjemalloc.so.2; \
rm -rf /var/lib/apt/* /var/cache/apt/* \
rm -rf /root/.cargo \
rm -rf /root/.cache
USER matrix
#ENV LD_PRELOAD="/usr/lib/libjemalloc.so.2"