correct dockerfile for vite
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -13,21 +13,19 @@ RUN npm ci
|
||||
# Copy the rest of the app
|
||||
COPY . .
|
||||
|
||||
# Build the app (React/Next/etc.)
|
||||
# Build the app
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Production image
|
||||
FROM node:20-alpine
|
||||
FROM alpine:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy only build output and dependencies
|
||||
COPY --from=builder /app/package*.json ./
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/build ./build
|
||||
# Copy only build frontend files
|
||||
COPY --from=builder /app/dist /app
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3000
|
||||
|
||||
# Default command
|
||||
CMD ["npm", "start"]
|
||||
CMD ["busybox", "httpd", "-f", "-p", "3000"]
|
||||
|
||||
Reference in New Issue
Block a user