FROM node:lts AS builder
ARG BASE_PATH=./
WORKDIR /src
COPY . /src
RUN yarn config set enableTelemetry 0 && \
    yarn install --immutable --network-timeout=300000 && \
    yarn build --base=$BASE_PATH

FROM ghcr.io/static-web-server/static-web-server:2
ENV SERVER_ROOT=/app
COPY --from=builder /src/dist /app
