ARG LOCAL_REGISTRY=127.0.0.1:5001
FROM ${LOCAL_REGISTRY}/mirror/node:22-alpine AS build
WORKDIR /src

RUN corepack enable

COPY src/food-market.web/package.json src/food-market.web/pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile

COPY src/food-market.web/ ./
RUN pnpm build

FROM ${LOCAL_REGISTRY}/mirror/nginx:1.27-alpine AS runtime
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /src/dist /usr/share/nginx/html

EXPOSE 80
