Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nonroot container #6

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ RUN set -eux; \
chmod +x docker/entrypoint.sh; \
addgroup -g 99 -S taiga; \
adduser -u 99 -S -D -G taiga -H -h /taiga-events -s /bin/sh taiga; \
chown -R taiga:taiga /taiga-events
chown -R taiga:0 /taiga-events; \
chmod g+rwX /taiga-events

EXPOSE 8888
ENTRYPOINT ["./docker/entrypoint.sh"]
18 changes: 14 additions & 4 deletions docker/entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,25 @@

set -e

cmd="npm run start:production"

if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ]; then
set -- node "$@"
fi

envsubst < /taiga-events/docker/env.template \
> /taiga-events/.env

chown -R taiga:taiga /taiga-events
if [ "$(id -u)" -eq 0 ]; then
chown -R taiga:taiga /taiga-events

# Start node process
echo Starting Taiga events
exec su-exec taiga npm run start:production
# Start node process
echo Starting Taiga events
# note: no quotes around $cmd to allow it to expand
exec su-exec taiga $cmd
else
# Start node process
echo Starting Taiga events
# note: no quotes around $cmd to allow it to expand
exec $cmd
fi