FROM node:21-alpine as builder

ARG API_BASE_URL="https://diagnostic-api.navigolabs.com"

ENV REACT_APP_API_BASE_URL $API_BASE_URL

WORKDIR /app

COPY package.json package.json
COPY yarn.lock yarn.lock

RUN yarn install --frozen-lockfile

COPY . .

RUN yarn build


FROM scratch

WORKDIR /app

COPY --from=builder /app/build ./build

CMD ["sh"]

