File size: 649 Bytes
a0f912d
 
bce7526
65737c0
fff9f59
bce7526
34c9a94
23e93de
bce7526
8f5c9dc
b1263f0
fff9f59
bce7526
8f5c9dc
23e93de
bce7526
 
8f5c9dc
bce7526
 
 
 
23e93de
fff9f59
bce7526
fff9f59
bce7526
 
b1263f0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM node:18-alpine

# Create app directory
WORKDIR /app

# Create non-root user
RUN addgroup -g 1001 -S nodejs && adduser -S nextjs -u 1001

# Copy package files and install dependencies
COPY package*.json ./
RUN npm install

# Copy full project source
COPY . .

# Copy static Vite config to a writable location
COPY temp-config/vite.config.mjs /tmp/vite.config.mjs

# Ensure correct permissions for runtime user
RUN chown -R nextjs:nodejs /app && chown -R nextjs:nodejs /tmp/vite.config.mjs

# Switch to non-root user
USER nextjs

# Expose Vite dev port
EXPOSE 7860

# Start Vite using the .mjs config from writable /tmp
CMD ["npm", "run", "dev"]