


Vite: dist / CRA: build (create react app)
# ===== 1. build stage =====
FROM node:18.19.1-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
RUN ls
RUN pwd
# ===== 2. runtime stage =====
FROM nginx:1.27-alpine
# 기본 설정 제거
RUN rm /etc/nginx/conf.d/default.conf
# React 빌드 결과 복사
# Vite: dist / CRA: build (create react app)
COPY --from=build /app/build /usr/share/nginx/html
# ⭐ 수정한 nginx.conf 적용
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 3001
CMD ["nginx", "-g", "daemon off;"]