# Build from an extracted, verified user-machine bundle, not a source checkout.
# This consumer image is separate from the internal environment machine image.
FROM node:22.23.2-bookworm-slim

WORKDIR /opt/hivecast/bundle
COPY manifest.json install.mjs packed-package-registry.mjs windows-user-machine-plan.mjs windows-user-command-path.mjs user-machine-install-plan.mjs ./
COPY packages/ ./packages/

USER node
RUN node install.mjs --install-root /home/node/.hivecast install

# Mount one named volume here per installation. Docker seeds a new empty volume
# with software only; neither the image nor a new volume has an enrolled home.
WORKDIR /home/node/.hivecast/deployment
STOPSIGNAL SIGTERM
ENTRYPOINT ["node", "/home/node/.hivecast/deployment/.hivedock/package-closure/install.mjs", "--install-root", "/home/node/.hivecast", "run"]
CMD ["--headless"]
