fix(docker): make sure the vikunja user always exists and only modify the uid instead of recreating the user
continuous-integration/drone/push Build is failing Details

Resolves #1392
This commit is contained in:
kolaente 2023-02-15 10:39:48 +01:00
parent 20a5994b17
commit eb33655c1c
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 5 additions and 3 deletions

View File

@ -33,7 +33,9 @@ ENV VIKUNJA_SERVICE_ROOTPATH=/app/vikunja/
ENV PUID 1000
ENV PGID 1000
RUN apk --update --no-cache add tzdata tini
RUN apk --update --no-cache add tzdata tini shadow && \
addgroup vikunja && \
adduser -s /bin/sh -D -G vikunja vikunja -h /app/vikunja -H
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod 0755 /entrypoint.sh && mkdir files

View File

@ -4,8 +4,8 @@ set -e
if [ -n "$PUID" ] && [ "$PUID" -ne 0 ] && \
[ -n "$PGID" ] && [ "$PGID" -ne 0 ] ; then
echo "info: creating the new user vikunja with $PUID:$PGID"
addgroup -g "$PGID" vikunja
adduser -s /bin/sh -D -G vikunja -u "$PUID" vikunja -h /app/vikunja -H
groupmod -g "$PGID" vikunja
usermod -u "$PUID" vikunja
chown -R vikunja:vikunja ./
exec su vikunja -c /app/vikunja/vikunja "$@"
else