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 the rest of the app
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the app (React/Next/etc.)
|
# Build the app
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Stage 2: Production image
|
# Stage 2: Production image
|
||||||
FROM node:20-alpine
|
FROM alpine:latest
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy only build output and dependencies
|
# Copy only build frontend files
|
||||||
COPY --from=builder /app/package*.json ./
|
COPY --from=builder /app/dist /app
|
||||||
COPY --from=builder /app/node_modules ./node_modules
|
|
||||||
COPY --from=builder /app/build ./build
|
|
||||||
|
|
||||||
# Expose port
|
# Expose port
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
# Default command
|
# Default command
|
||||||
CMD ["npm", "start"]
|
CMD ["busybox", "httpd", "-f", "-p", "3000"]
|
||||||
|
|||||||
Reference in New Issue
Block a user