# Soveren360 re-skin of the CISO Assistant Community frontend (AGPLv3, no enterprise code).
ARG UPSTREAM_IMAGE

FROM ${UPSTREAM_IMAGE} AS upstream

# The upstream image has no shell, so patching happens in a throwaway node stage.
FROM node:22-alpine AS patcher
ARG ATTRIB_URL
ARG SOURCE_URL
ARG BRAND=Soveren360
COPY --from=upstream /app /app
COPY . /theme
RUN node /theme/patch.mjs

# Final image = untouched upstream + only the files the patcher wrote.
FROM ${UPSTREAM_IMAGE}
COPY --from=patcher /out/ /
