Files
blog/Dockerfile
Vishesh 'ironeagle' Bangotra 32687fee5a
Some checks failed
continuous-integration/drone/tag Build is failing
continuous-integration/drone Build is passing
correct dockerfile for vite
2025-10-31 19:30:12 +05:30

32 lines
495 B
Docker

# Stage 1: Build
FROM node:20-alpine AS builder
# Set working directory
WORKDIR /app
# Copy package.json and package-lock.json (or yarn.lock)
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy the rest of the app
COPY . .
# Build the app
RUN npm run build
# Stage 2: Production image
FROM alpine:latest
WORKDIR /app
# Copy only build frontend files
COPY --from=builder /app/dist /app
# Expose port
EXPOSE 3000
# Default command
CMD ["busybox", "httpd", "-f", "-p", "3000"]