Files
wordcloud/frontend/Dockerfile
T
2026-07-04 02:40:45 +08:00

26 lines
725 B
Docker

# syntax=docker/dockerfile:1
# ── Stage 1: Build React app ───────────────────────────────────────────────
FROM node:20-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
COPY . .
RUN npm run build
# ── Stage 2: Serve with Nginx ──────────────────────────────────────────────
FROM nginx:alpine
# Copy custom nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy built static files
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]