# Local preview for the docs site, in a container. # # The plain path is `npm run dev --workspace docs`, which serves # http://localhost:3000 with no Docker at all — use that unless you specifically # want an isolated toolchain. This file exists for sandboxes and for # "works on a clean machine" checks. # # docker compose -f compose.dev.yml up # # Vendor-neutral by construction. A remote sandbox that serves the preview # through its own hostname sets DEV_ALLOWED_ORIGINS to that host; nothing here # encodes a particular provider's name, env-var spelling, or port scheme. # # DEV_ALLOWED_ORIGINS=3000-my-sandbox.example docker compose -f compose.dev.yml up # # Port is the standard 3000 and is overridable with PORT. services: docs: image: node:24-slim working_dir: /app volumes: - ./:/app ports: - '${PORT:-3000}:3000' environment: # The root `prepare` script installs git hooks, which are meaningless in a # container and fail without a git identity. Every other postinstall # (fumadocs-mdx, etc.) still runs. - LEFTHOOK=0 # Empty unless a sandbox sets it — see apps/docs/next.config.mjs. - DEV_ALLOWED_ORIGINS=${DEV_ALLOWED_ORIGINS:-} command: >- bash -lc ' set -e; [ -d node_modules ] || npm install --no-audit --no-fund; npm run build --workspace @interlace/ui; exec npm run dev --workspace docs -- --hostname 0.0.0.0; ' healthcheck: test: - CMD - node - -e - "fetch('http://localhost:3000/').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))" interval: 15s timeout: 5s retries: 40 # A cold `npm install` across this monorepo is slow; do not fail it early. start_period: 300s