prosody-docker/Dockerfile

122 lines
4.2 KiB
Docker
Raw Permalink Normal View History

2024-03-01 12:55:03 +01:00
FROM debian:bookworm-slim
2024-03-01 12:50:08 +01:00
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
ARG LUAROCKS_VERSION=3.9.2
2024-03-01 12:55:03 +01:00
ARG PROSODY_VERSION=0.12.4
2024-03-01 12:50:08 +01:00
2024-03-01 12:55:03 +01:00
ARG LUAROCKS_SHA256="bca6e4ecc02c203e070acdb5f586045d45c078896f6236eb46aa33ccd9b94edb"
ARG PROSODY_DOWNLOAD_SHA256="47d712273c2f29558c412f6cdaec073260bbc26b7dda243db580330183d65856"
2024-03-01 12:50:08 +01:00
LABEL luarocks.version="${LUAROCKS_VERSION}"
LABEL org.opencontainers.image.authors="Wproject Garapenak"
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://git.lainoa.eus/aitzol/prosody-docker/src/branch/main/readme.md"
LABEL org.opencontainers.image.revision="${VCS_REF}"
LABEL org.opencontainers.image.source="https://git.lainoa.eus/aitzol/prosody-docker"
LABEL org.opencontainers.image.title="prosody"
LABEL org.opencontainers.image.url="https://git.lainoa.eus/aitzol/prosody-docker"
LABEL org.opencontainers.image.vendor="Wproject Garapenak"
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` \
2024-03-01 12:55:03 +01:00
libicu72 \
libidn2-0 \
2024-03-01 12:50:08 +01:00
libpq-dev \
libsqlite3-0 \
lua5.2 \
lua-bitop \
lua-dbi-mysql \
2024-03-01 12:55:03 +01:00
lua-dbi-postgresql \
2024-03-01 12:50:08 +01:00
lua-expat \
lua-filesystem \
lua-ldap \
lua-socket \
lua-sec \
lua-unbound \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
2024-03-01 12:55:03 +01:00
RUN buildDeps='gcc git libc6-dev libidn2-dev liblua5.2-dev libsqlite3-dev libssl-dev libicu-dev make unzip' \
2024-03-01 12:50:08 +01:00
&& set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
\
# prosody \
&& 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 \
# prosody-migrator \
&& cd /usr/src/prosody/tools/migration \
&& 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/
ENV __FLUSH_LOG yes
VOLUME ["/usr/local/var/lib/prosody"]
COPY prosody.cfg.lua /usr/local/etc/prosody/prosody.cfg.lua
COPY migrator.cfg.lua /usr/local/etc/prosody/migrator.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 \
2024-05-05 16:40:57 +02:00
#bookmarks `# XEP-0411: Bookmarks Conversion` \
#carbons `# message carbons (XEP-0280)` \
2024-03-01 12:50:08 +01:00
cloud_notify `# XEP-0357: Push Notifications` \
2024-05-05 16:40:57 +02:00
#csi `# client state indication (XEP-0352)` \
2024-03-01 12:50:08 +01:00
e2e_policy `# require end-2-end encryption` \
filter_chatstates `# disable "X is typing" type messages` \
2024-05-05 16:40:57 +02:00
#smacks `# stream management (XEP-0198)` \
2024-03-01 12:50:08 +01:00
throttle_presence `# presence throttling in CSI` \
vcard_muc `# XEP-0153: vCard-Based Avatar (MUC)` \
2024-03-01 17:09:43 +01:00
firewall `# anti-spam firewall` \
2024-03-01 12:50:08 +01:00
&& rm -rf "/usr/src/prosody-modules"
RUN echo "TLS_REQCERT allow" >> /etc/ldap/ldap.conf
2024-03-01 13:03:42 +01:00
2024-03-01 12:50:08 +01:00
USER prosody
ENTRYPOINT ["/entrypoint.bash"]
CMD ["prosody", "-F"]