forked from shaula/rpi-prosody
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
113 lines (96 loc) · 3.81 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
112
FROM debian:bookworm-slim
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
ARG LUAROCKS_VERSION=3.11.1
ARG PROSODY_VERSION=0.12.4
ARG LUAROCKS_SHA256="c3fb3d960dffb2b2fe9de7e3cb004dc4d0b34bb3d342578af84f84325c669102"
ARG PROSODY_DOWNLOAD_SHA256="47d712273c2f29558c412f6cdaec073260bbc26b7dda243db580330183d65856"
LABEL luarocks.version="${LUAROCKS_VERSION}"
LABEL org.opencontainers.image.authors="Sara Smiseth"
LABEL org.opencontainers.image.created="${BUILD_DATE}"
LABEL org.opencontainers.image.description="This docker image provides you with a configured Prosody XMPP server."
LABEL org.opencontainers.image.documentation="https://github.com/SaraSmiseth/prosody/blob/dev/readme.md"
LABEL org.opencontainers.image.revision="${VCS_REF}"
LABEL org.opencontainers.image.source="https://github.com/SaraSmiseth/prosody/archive/dev.zip"
LABEL org.opencontainers.image.title="prosody"
LABEL org.opencontainers.image.url="https://github.com/SaraSmiseth/prosody"
LABEL org.opencontainers.image.vendor="Sara Smiseth"
LABEL org.opencontainers.image.version="${VERSION}"
LABEL prosody.version="${PROSODY_VERSION}"
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
libevent-dev `# this is no build dependency, but needed for luaevent` \
libicu72 \
libidn2-0 \
libpq-dev \
libsqlite3-0 \
lua5.2 \
lua-bitop \
lua-dbi-mysql \
lua-dbi-postgresql \
lua-expat \
lua-filesystem \
lua-ldap \
lua-socket \
lua-sec \
lua-unbound \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN buildDeps='gcc git libc6-dev libidn2-dev liblua5.2-dev libsqlite3-dev libssl-dev libicu-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 "https://prosody.im/downloads/source/prosody-${PROSODY_VERSION}.tar.gz" \
&& echo "${PROSODY_DOWNLOAD_SHA256} *prosody.tar.gz" | sha256sum -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 \
&& make 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 \
&& echo "${LUAROCKS_SHA256} luarocks-${LUAROCKS_VERSION}.tar.gz" | sha256sum -c - \
&& tar zxpf luarocks-${LUAROCKS_VERSION}.tar.gz \
&& cd luarocks-${LUAROCKS_VERSION} \
&& ./configure \
&& make bootstrap \
&& cd / && rm -r /usr/src/luarocks \
\
&& luarocks install luaevent \
&& luarocks install luadbi \
`#&& luarocks install luadbi-mysql MYSQL_INCDIR=/usr/include/mariadb/` \
&& luarocks install luadbi-sqlite3 \
&& luarocks install stringy \
\
&& apt-get purge -y --auto-remove $buildDeps
EXPOSE 5000 5222 5223 5269 5347 5280 5281
RUN groupadd -r prosody \
&& useradd -r -g prosody prosody \
&& chown prosody:prosody /usr/local/var/lib/prosody
RUN mkdir -p /var/run/prosody/ \
&& chown prosody:prosody /var/run/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.bash /entrypoint.bash
COPY conf.d/*.cfg.lua /usr/local/etc/prosody/conf.d/
COPY *.bash /usr/local/bin/
RUN download-prosody-modules.bash \
&& docker-prosody-module-install.bash \
cloud_notify `# XEP-0357: Push Notifications` \
e2e_policy `# require end-2-end encryption` \
filter_chatstates `# disable "X is typing" type messages` \
throttle_presence `# presence throttling in CSI` \
vcard_muc `# XEP-0153: vCard-Based Avatar (MUC)` \
&& rm -rf "/usr/src/prosody-modules"
USER prosody
ENTRYPOINT ["/entrypoint.bash"]
CMD ["prosody", "-F"]