# 前端：vite build 出靜態檔，交給 nginx serve，並把 /api 反代到 gateway 容器。
# build context = repo root（見 deploy/docker-compose.yml）。

FROM node:22-alpine AS build
WORKDIR /app
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build

FROM nginx:alpine
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
