fix: Use built-in node user to avoid GID conflicts
- Remove custom nodejs user creation that was causing GID 1000 conflicts - Use the built-in 'node' user from node:alpine image - Update volume mount path from /home/nodejs to /home/node - Simplify Dockerfile by removing unnecessary user creation This fixes the "addgroup: gid '1000' in use" error during Docker build. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -11,10 +11,6 @@ RUN apk add --no-cache bash
|
||||
# Create app directory
|
||||
WORKDIR /app
|
||||
|
||||
# Create non-root user (same UID/GID as most development systems)
|
||||
RUN addgroup -g 1000 -S nodejs && \
|
||||
adduser -S nodejs -u 1000 -G nodejs
|
||||
|
||||
# Copy package files
|
||||
COPY package*.json ./
|
||||
|
||||
@@ -29,11 +25,11 @@ RUN mkdir -p logs temp && \
|
||||
# Copy application files
|
||||
COPY . .
|
||||
|
||||
# Change ownership of everything to nodejs user
|
||||
RUN chown -R nodejs:nodejs /app
|
||||
# Change ownership of everything to node user (built-in)
|
||||
RUN chown -R node:node /app
|
||||
|
||||
# Switch to non-root user
|
||||
USER nodejs
|
||||
USER node
|
||||
|
||||
# Set development environment
|
||||
ENV NODE_ENV=development
|
||||
|
||||
Reference in New Issue
Block a user