SimulationEmbed React island with click-to-activate iframes, theme sync via postMessage/MutationObserver, and graceful fallback when SpiceBook is unavailable. 12 simulations across 6 books (555 timer, op-amp, semiconductor, formulas, communications, sensor). Books without simulations render no extra markup. client:visible hydration defers JS cost until scrolled into view.
28 lines
708 B
YAML
28 lines
708 B
YAML
services:
|
|
mims-library:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: ${MODE:-production}
|
|
args:
|
|
- SITE_URL=${SITE_URL:-https://forrest.warehack.ing}
|
|
- PUBLIC_SPICEBOOK_URL=${PUBLIC_SPICEBOOK_URL:-https://spicebook.warehack.ing}
|
|
container_name: mims-library
|
|
restart: unless-stopped
|
|
environment:
|
|
- NODE_ENV=${NODE_ENV:-production}
|
|
- HOST=0.0.0.0
|
|
- PORT=4321
|
|
volumes:
|
|
# Dev mode: mount source for hot reload
|
|
- ${DEV_MOUNT:-/dev/null}:/app/src:ro
|
|
networks:
|
|
- caddy
|
|
labels:
|
|
caddy: ${CADDY_HOST:-mims.localhost}
|
|
caddy.reverse_proxy: "{{upstreams 4321}}"
|
|
|
|
networks:
|
|
caddy:
|
|
external: true
|