Use sudo, add luarocks, and remove deprecated config

This commit is contained in:
William Brawner 2024-05-14 20:47:21 -06:00
parent 2b1533cb0e
commit 645e890730
Signed by: wbrawner
GPG key ID: 8FF12381C6C90D35
2 changed files with 7 additions and 3 deletions

View file

@ -37,13 +37,16 @@ RUN apt-get update \
lua5.2 \
lua5.3 \
lua5.4 \
luarocks \
openssl \
prosody \
sudo \
&& rm -rf /var/lib/apt/lists/*
RUN update-alternatives --set lua-interpreter /usr/bin/lua5.4
# Configure prosody
RUN sed -i '1s/^/daemonize = false;\n/' /etc/prosody/prosody.cfg.lua \
&& perl -i -pe 'BEGIN{undef $/;} s/^log = {.*?^}$/log = {\n {levels = {min = "info"}, to = "console"};\n}/smg' /etc/prosody/prosody.cfg.lua
RUN perl -i -pe 'BEGIN{undef $/;} s/^log = {.*?^}$/log = {\n {levels = {min = "info"}, to = "console"};\n}/smg' /etc/prosody/prosody.cfg.lua
RUN mkdir -p /var/run/prosody && chown prosody:prosody /var/run/prosody

View file

@ -18,4 +18,5 @@ if [[ "$LOCAL" && "$PASSWORD" && "$DOMAIN" ]]; then
prosodyctl register "$LOCAL" "$DOMAIN" "$PASSWORD"
fi
exec setpriv --reuid=prosody --regid=prosody --init-groups "$@"
pushd /var/run/prosody
exec sudo -Eu prosody -- "$@"