# --- build -----------------------------------------------------------------
FROM node:24-alpine AS build
WORKDIR /app

COPY package.json package-lock.json ./
RUN npm ci

COPY . .
RUN npm run build
# Angular's application builder emits the browser bundle to dist/frontend/browser.

# --- runtime ---------------------------------------------------------------
FROM nginx:1.27-alpine
# Serve the SPA and proxy /api to the api service (same origin, so no CORS).
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist/frontend/browser /usr/share/nginx/html
EXPOSE 80
