From 2c9d4cb57ef9ee18d6a009fb45d9a4166baada8f Mon Sep 17 00:00:00 2001 From: aronmal Date: Fri, 23 Feb 2024 23:05:07 +0100 Subject: [PATCH] Fix: docker gid and uid --- Dockerfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index f364fb8..de3c86a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,14 +33,16 @@ RUN npm run build FROM base AS runner WORKDIR /app -RUN addgroup --system --gid 1001 nodejs \ - && adduser --system --uid 1001 solidjs +# Remove existing 'node' user and create a new user 'node' with UID 99 and use the existing group with GID 100 +RUN deluser --remove-home node \ + && adduser -S -G users -u 99 node COPY --from=builder /app/public ./public -COPY --from=builder --chown=solidjs:nodejs /app/.output ./.output -COPY --from=builder --chown=solidjs:nodejs /app/.vinxi ./.vinxi +COPY --from=builder --chown=node:users /app/.output ./.output +COPY --from=builder --chown=node:users /app/.vinxi ./.vinxi -USER solidjs +# Switch to the non-root user +USER node EXPOSE 3000