# Patient web app: build with Node in a throwaway stage, serve the static bundle with nginx (+ /api → app).
# The jury only needs Docker: `make up` builds and starts it (http://localhost:8080).
FROM node:20-alpine AS build
WORKDIR /w
COPY package.json package-lock.json ./
RUN npm ci --no-audit --no-fund
COPY . .
RUN npm run build

FROM nginx:1.27-alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /w/dist /usr/share/nginx/html
