Hanzo Dev commited on
Commit
5ae1198
·
1 Parent(s): ebcd728

Fix Docker permissions

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -1
Dockerfile CHANGED
@@ -2,9 +2,21 @@ FROM node:20-slim
2
 
3
  WORKDIR /app
4
 
 
 
 
 
 
5
  COPY . .
6
 
7
- RUN npm install --legacy-peer-deps
 
 
 
 
 
 
 
8
 
9
  EXPOSE 3000
10
 
 
2
 
3
  WORKDIR /app
4
 
5
+ # Copy and install dependencies first
6
+ COPY package*.json ./
7
+ RUN npm install --legacy-peer-deps
8
+
9
+ # Copy the rest of the app
10
  COPY . .
11
 
12
+ # Create .next directory with proper permissions
13
+ RUN mkdir -p .next && chmod -R 777 .next
14
+
15
+ # Ensure node user owns the app
16
+ RUN chown -R node:node /app
17
+
18
+ # Switch to node user
19
+ USER node
20
 
21
  EXPOSE 3000
22