FROM ghcr.io/pnpm/pnpm:latest as Builder
ENV CI=true
RUN pnpm runtime set node 22 -g
RUN apt update
RUN apt install git -y

WORKDIR /app
COPY pnpm-lock.yaml /app
RUN pnpm fetch --prod

COPY . /app
# Built files are in ./build
RUN pnpm run build

FROM ghcr.io/static-web-server/static-web-server:latest
WORKDIR /
COPY --from=Builder /app/build /public
