vikunja/docker/entrypoint.sh
kolaente 80266d1383
All checks were successful
continuous-integration/drone/push Build is passing
fix(docker): don't chown everything in Vikunja's default root folder
This would try to chown a mounted Vikunja config file as well which failed when that config file was mounted read-only.
2023-03-13 11:23:51 +01:00

16 lines
445 B
Bash

#!/usr/bin/env sh
set -e
if [ -n "$PUID" ] && [ "$PUID" -ne 0 ] && \
[ -n "$PGID" ] && [ "$PGID" -ne 0 ] ; then
echo "info: creating the new user vikunja with $PUID:$PGID"
groupmod -g "$PGID" -o vikunja
usermod -u "$PUID" -o vikunja
chown -R vikunja:vikunja ./files/
chown vikunja:vikunja .
exec su vikunja -c /app/vikunja/vikunja "$@"
else
echo "info: creation of non-root user is skipped"
exec /app/vikunja/vikunja "$@"
fi