FROM node:22.18.0-bookworm-slim AS portal-builder
WORKDIR /portal
ENV NEXT_TELEMETRY_DISABLED=1
COPY koc-portal/package.json koc-portal/package-lock.json ./
RUN npm ci
COPY koc-portal/ ./
RUN npm run build

FROM nginx:1.27-alpine
COPY deploy/nginx/koc-loop.conf /etc/nginx/conf.d/default.conf
COPY --from=portal-builder /portal/out /usr/share/nginx/html/koc
