browser / Dockerfile
no-name-here's picture
Update Dockerfile
bce7526 verified
raw
history blame contribute delete
649 Bytes
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"]