# b2g_website/Dockerfile
FROM public.ecr.aws/docker/library/node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
# ngx-numeric-captcha@1.1.2 declares a stale peer range (@angular/common
# ">=16.0.0 <21.0.0") while this app is on Angular 21.2, so a strict npm ci
# fails ERESOLVE. Matches the other three SPAs in this repo.
RUN npm ci --legacy-peer-deps
COPY . .
RUN npx ng build --configuration=docker

FROM public.ecr.aws/docker/library/nginx:alpine
COPY --from=build /app/dist/b2g-frontend/browser /usr/share/nginx/html
COPY docker/nginx-spa.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
