Skip to content

Commit

Permalink
Use tini as PID 1 inside the container
Browse files Browse the repository at this point in the history
tini [1] is a minimalistic PID 1 process. It correctly handles
the special jobs which PID 1 (or a reaper process in general)
needs to take care of in addition to correctly processing the
relevant signals.

Fixes prosody#68.

   [1]: https://github.com/krallin/tini
  • Loading branch information
horazont committed Mar 20, 2021
1 parent d627c29 commit 139740e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ RUN apt-get update \
openssl \
ca-certificates \
ssl-cert \
tini \
&& rm -rf /var/lib/apt/lists/*

# Install and configure prosody
Expand Down
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ if [[ "$(stat -c %u /var/run/prosody/)" != "$data_dir_owner" ]]; then
fi

if [[ "$1" != "prosody" ]]; then
exec prosodyctl "$@"
exec tini -- prosodyctl "$@"
exit 0;
fi

if [[ "$LOCAL" && "$PASSWORD" && "$DOMAIN" ]]; then
prosodyctl register "$LOCAL" "$DOMAIN" "$PASSWORD"
fi

exec runuser -u prosody -- "$@"
exec tini -- runuser -u prosody -- "$@"

0 comments on commit 139740e

Please sign in to comment.