no-name-here commited on
Commit
d39111e
·
verified ·
1 Parent(s): d4fa8d1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -6
Dockerfile CHANGED
@@ -1,8 +1,7 @@
1
- FROM node:18-alpine
2
-
3
  WORKDIR /app
4
 
5
- # Create user
6
  RUN addgroup -g 1001 -S nodejs && adduser -S nextjs -u 1001
7
 
8
  COPY package*.json ./
@@ -10,10 +9,10 @@ RUN npm install
10
 
11
  COPY . .
12
 
13
- # Compile vite.config.ts to vite.config.js in a safe temp dir
14
- RUN npm run build:config && cp build-config/vite.config.js vite.config.js
15
 
16
- # Ensure no write operations are needed in /app
17
  USER nextjs
18
 
19
  EXPOSE 7860
 
1
+ # Create app dir
 
2
  WORKDIR /app
3
 
4
+ # Add user
5
  RUN addgroup -g 1001 -S nodejs && adduser -S nextjs -u 1001
6
 
7
  COPY package*.json ./
 
9
 
10
  COPY . .
11
 
12
+ # Build and move config to writable /tmp
13
+ RUN npm run build:config && mkdir -p /tmp/vite-config && cp build-config/vite.config.js /tmp/vite-config/vite.config.js
14
 
15
+ # Use non-root user
16
  USER nextjs
17
 
18
  EXPOSE 7860