FROM node:20-alpine as builder

ARG API_BASE_URL="https://gemtrack-backend.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

COPY . .

RUN yarn build


FROM nginx:1.25-alpine

# Copy compiled assets from the builder stage
COPY --from=builder /app/dist/public /usr/share/nginx/html

EXPOSE 80
