Skip to content

Commit 147d28e

Browse files
committed
fix: run container as root to avoid permission issues
Removed nodejs user and USER directive to run as root. This matches the original working setup before non-root user was added.
1 parent 556dcb8 commit 147d28e

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

Dockerfile

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ FROM node:20-alpine
2121
# Install gettext for envsubst
2222
RUN apk add --no-cache gettext
2323

24-
# Create non-root user for security
25-
RUN addgroup -g 1001 -S nodejs && \
26-
adduser -S nodejs -u 1001
27-
2824
# Copy built assets from builder stage
2925
COPY --from=builder /app/dist /usr/share/nginx/html
3026

@@ -34,12 +30,8 @@ COPY server.js /usr/share/nginx/html/server.js
3430
# Copy env template
3531
COPY env.js.template /usr/share/nginx/html/env.js.template
3632

37-
# Create config directory and set ownership
38-
RUN mkdir -p /config && \
39-
chown -R nodejs:nodejs /usr/share/nginx/html /config
40-
41-
# Switch to non-root user
42-
USER nodejs
33+
# Create config directory
34+
RUN mkdir -p /config
4335

4436
# Expose port 80
4537
EXPOSE 80

0 commit comments

Comments
 (0)