# syntax=docker/dockerfile:1

FROM --platform=$BUILDPLATFORM node:22-alpine AS build
ARG REGISTRY_TOKEN
WORKDIR /ui
COPY package.json package-lock.json .npmrc ./
RUN --mount=type=cache,target=/root/.npm echo "//gitea.siegeln.net/api/packages/cameleer/npm/:_authToken=${REGISTRY_TOKEN}" >> .npmrc && npm ci
COPY . .
RUN npm run build

FROM ghcr.io/logto-io/logto:latest
COPY --from=build /ui/dist/ /etc/logto/packages/experience/dist/
