# E2E test layer: copies locally-built public apps into Ghost's content folder
# so Ghost serves them from /content/files/* (same origin, no CORS).
#
# Usage:
#   docker build -f e2e/Dockerfile.e2e \
#     --build-arg GHOST_IMAGE=ghost-monorepo:latest \
#     -t ghost-e2e:local .
#
# Intended for the production Ghost image built in CI.

ARG GHOST_IMAGE=ghost-monorepo:latest
FROM $GHOST_IMAGE

# Public app UMD bundles — Ghost serves these from /content/files/
COPY apps/portal/umd /home/ghost/content/files/portal
COPY apps/comments-ui/umd /home/ghost/content/files/comments-ui
COPY apps/sodo-search/umd /home/ghost/content/files/sodo-search
COPY apps/signup-form/umd /home/ghost/content/files/signup-form
COPY apps/announcement-bar/umd /home/ghost/content/files/announcement-bar

ENV portal__url=/content/files/portal/portal.min.js
ENV comments__url=/content/files/comments-ui/comments-ui.min.js
ENV sodoSearch__url=/content/files/sodo-search/sodo-search.min.js
ENV sodoSearch__styles=/content/files/sodo-search/main.css
ENV signupForm__url=/content/files/signup-form/signup-form.min.js
ENV announcementBar__url=/content/files/announcement-bar/announcement-bar.min.js
