Merge pull request #62 from prosody/dynamic-uid
Run with same UID as datadir owner
This commit is contained in:
commit
90963038ee
2 changed files with 3 additions and 2 deletions
|
@ -51,6 +51,5 @@ RUN chmod 755 /entrypoint.sh
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
||||||
EXPOSE 80 443 5222 5269 5347 5280 5281
|
EXPOSE 80 443 5222 5269 5347 5280 5281
|
||||||
USER prosody
|
|
||||||
ENV __FLUSH_LOG yes
|
ENV __FLUSH_LOG yes
|
||||||
CMD ["prosody", "-F"]
|
CMD ["prosody", "-F"]
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
usermod -u "$(stat -c %u /var/lib/prosody/.)" prosody
|
||||||
|
|
||||||
if [[ "$1" != "prosody" ]]; then
|
if [[ "$1" != "prosody" ]]; then
|
||||||
exec prosodyctl "$@"
|
exec prosodyctl "$@"
|
||||||
exit 0;
|
exit 0;
|
||||||
|
@ -10,4 +12,4 @@ if [ "$LOCAL" -a "$PASSWORD" -a "$DOMAIN" ] ; then
|
||||||
prosodyctl register "$LOCAL" "$DOMAIN" "$PASSWORD"
|
prosodyctl register "$LOCAL" "$DOMAIN" "$PASSWORD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
runuser -u prosody -- "$@"
|
||||||
|
|
Loading…
Reference in a new issue