AleksanderObuchowski commited on
Commit
86aa5b0
·
1 Parent(s): 5a6d652

Use existing UID 1000 instead of creating new user

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -8
Dockerfile CHANGED
@@ -29,22 +29,22 @@ FROM node:18-alpine AS production
29
  # Install dumb-init
30
  RUN apk add --no-cache dumb-init
31
 
32
- # Create user with UID 1000 as required by HF Spaces
33
- RUN adduser -S user -u 1000 -G root
34
 
35
  # Set working directory
36
  WORKDIR /app
37
 
38
  # Copy backend dependencies and source
39
- COPY --from=base --chown=user /app/backend/node_modules ./backend/node_modules
40
- COPY --chown=user backend/ ./backend/
41
- COPY --chown=user data/ ./data/
42
 
43
  # Copy built frontend
44
- COPY --from=frontend-build --chown=user /app/frontend/dist ./frontend/dist
45
 
46
- # Switch to user
47
- USER user
48
 
49
  # Expose port
50
  EXPOSE 3001
 
29
  # Install dumb-init
30
  RUN apk add --no-cache dumb-init
31
 
32
+ # Use existing user with UID 1000 (required by HF Spaces)
33
+ # No need to create user - HF Spaces already has one
34
 
35
  # Set working directory
36
  WORKDIR /app
37
 
38
  # Copy backend dependencies and source
39
+ COPY --from=base --chown=1000:1000 /app/backend/node_modules ./backend/node_modules
40
+ COPY --chown=1000:1000 backend/ ./backend/
41
+ COPY --chown=1000:1000 data/ ./data/
42
 
43
  # Copy built frontend
44
+ COPY --from=frontend-build --chown=1000:1000 /app/frontend/dist ./frontend/dist
45
 
46
+ # Switch to user with UID 1000
47
+ USER 1000
48
 
49
  # Expose port
50
  EXPOSE 3001