Fix: docker gid and uid
This commit is contained in:
parent
ba327bef1a
commit
2c9d4cb57e
1 changed files with 7 additions and 5 deletions
12
Dockerfile
12
Dockerfile
|
@ -33,14 +33,16 @@ RUN npm run build
|
||||||
FROM base AS runner
|
FROM base AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN addgroup --system --gid 1001 nodejs \
|
# Remove existing 'node' user and create a new user 'node' with UID 99 and use the existing group with GID 100
|
||||||
&& adduser --system --uid 1001 solidjs
|
RUN deluser --remove-home node \
|
||||||
|
&& adduser -S -G users -u 99 node
|
||||||
|
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
COPY --from=builder --chown=solidjs:nodejs /app/.output ./.output
|
COPY --from=builder --chown=node:users /app/.output ./.output
|
||||||
COPY --from=builder --chown=solidjs:nodejs /app/.vinxi ./.vinxi
|
COPY --from=builder --chown=node:users /app/.vinxi ./.vinxi
|
||||||
|
|
||||||
USER solidjs
|
# Switch to the non-root user
|
||||||
|
USER node
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue