This repository has been archived by the owner on Feb 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
/
Dockerfile
94 lines (87 loc) · 2.36 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
FROM 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=master
ARG BV_TUR=master
ARG TAG_SYN=v1.3.1
# 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 \
&& 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=' \
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 \
linux-headers-amd64 \
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 \
libjemalloc2 \
zlib1g \
; \
pip3 install --upgrade wheel ;\
pip3 install --upgrade psycopg2;\
pip3 install --upgrade python-ldap ;\
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
USER matrix
ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libjemalloc.so.2"