-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
85 lines (73 loc) · 2.75 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
FROM resin/rpi-raspbian
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
libevent-dev `# this is no build dependency, but needed for luaevent` \
lua5.2 \
lua-bitop \
lua-expat \
lua-filesystem \
lua-socket \
lua-sec \
sqlite3 \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
#https://prosody.im/downloads/source/
ENV PROSODY_VERSION 0.11.6
ENV PROSODY_DOWNLOAD_URL https://prosody.im/downloads/source/prosody-${PROSODY_VERSION}.tar.gz
ENV PROSODY_DOWNLOAD_SHA1 3c24f3faf7735c570213da74eba6343c3afdf50d
#https://luarocks.org/#quick-start
ENV LUAROCKS_VERSION 3.3.1
RUN buildDeps='gcc git libc6-dev libidn11-dev liblua5.2-dev libsqlite3-dev libssl-dev make unzip' \
&& set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
\
&& wget -O prosody.tar.gz "${PROSODY_DOWNLOAD_URL}" \
&& echo "${PROSODY_DOWNLOAD_SHA1} *prosody.tar.gz" | sha1sum -c - \
&& mkdir -p /usr/src/prosody \
&& tar -xzf prosody.tar.gz -C /usr/src/prosody --strip-components=1 \
&& rm prosody.tar.gz \
&& cd /usr/src/prosody && ./configure \
&& make -C /usr/src/prosody \
&& make -C /usr/src/prosody install \
&& cd / && rm -r /usr/src/prosody \
\
&& mkdir /usr/src/luarocks \
&& cd /usr/src/luarocks \
&& wget https://luarocks.org/releases/luarocks-${LUAROCKS_VERSION}.tar.gz \
&& tar zxpf luarocks-${LUAROCKS_VERSION}.tar.gz \
&& cd luarocks-${LUAROCKS_VERSION} \
&& ./configure \
&& sudo make bootstrap \
&& cd / && rm -r /usr/src/luarocks \
\
&& luarocks install luaevent \
&& luarocks install luadbi \
&& luarocks install luadbi-sqlite3 \
\
&& apt-get purge -y --auto-remove $buildDeps
EXPOSE 5000 5222 5269 5347 5280 5281
RUN groupadd -r prosody \
&& useradd -r -g prosody prosody \
&& chown prosody:prosody /usr/local/var/lib/prosody
# https://github.com/prosody/prosody-docker/issues/25
ENV __FLUSH_LOG yes
VOLUME ["/usr/local/var/lib/prosody"]
COPY prosody.cfg.lua /usr/local/etc/prosody/prosody.cfg.lua
COPY docker-entrypoint.sh /entrypoint.sh
COPY conf.d/*.cfg.lua /usr/local/etc/prosody/conf.d/
COPY docker-prosody-module-* /usr/local/bin/
RUN docker-prosody-module-install \
blocking `# blocking command (XEP-0191)` \
carbons `# message carbons (XEP-0280)` \
csi `# client state indication (XEP-0352)` \
e2e_policy `# require end-2-end encryption` \
filter_chatstates `# disable "X is typing" type messages` \
http_upload `# easy file sharing (XEP-0363)` \
http_upload_external `# advanced file sharing (XEP-0363)` \
smacks `# stream management (XEP-0198)` \
throttle_presence `# presence throttling in CSI`
USER prosody
ENTRYPOINT ["/entrypoint.sh"]
CMD ["prosody"]