FROM node:24-alpine AS builder

ARG API_BASE_URL="https://mfs-api.midastix.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
RUN yarn install

# COPY . .
COPY public public
COPY src src
COPY tsconfig.json tsconfig.json
# COPY .yarnrc.yml .yarnrc.yml

RUN yarn build


FROM scratch

WORKDIR /app

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

CMD ["sh"]

