All checks were successful
continuous-integration/drone/tag Build is passing
32 lines
508 B
Docker
32 lines
508 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: Static file server (BusyBox)
|
|
FROM busybox: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"]
|