ES module imports fail via file:// or raw Forge URLs (CORS + missing Content-Type). boot.js already detects this and warns users. Three deployment options: - ./preview.sh — local Python server, correct MIME types - docker compose up nexus-preview — nginx + WS proxy on :8080 - Push to main — GitHub Pages auto-deploy via CI Files: - Dockerfile.preview: nginx preview container - preview/nginx.conf: correct MIME types + /api/world/ws proxy - preview.sh: Python one-liner preview server - PREVIEW.md: deployment documentation - .github/workflows/pages.yml: GitHub Pages CI/CD - docker-compose.yml: added nexus-preview + nexus-backend - deploy.sh: added preview/full modes Fixes #1339
35 lines
1.1 KiB
Bash
Executable File
35 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# deploy.sh — spin up (or update) the Nexus environment
|
|
# Usage: ./deploy.sh — rebuild nexus-main (port 8765)
|
|
# ./deploy.sh staging — rebuild nexus-staging (port 8766)
|
|
# ./deploy.sh preview — deploy static preview (port 8080)
|
|
# ./deploy.sh full — deploy preview + backend
|
|
set -euo pipefail
|
|
|
|
SERVICE="${1:-nexus-main}"
|
|
|
|
case "$SERVICE" in
|
|
staging) SERVICE="nexus-staging" ;;
|
|
main) SERVICE="nexus-main" ;;
|
|
preview)
|
|
echo "==> Deploying Nexus preview on http://localhost:8080"
|
|
docker compose build nexus-preview
|
|
docker compose up -d --force-recreate nexus-preview
|
|
echo "==> Preview at http://localhost:8080"
|
|
exit 0
|
|
;;
|
|
full)
|
|
echo "==> Deploying full Nexus stack (preview + backend)"
|
|
docker compose build nexus-preview nexus-backend
|
|
docker compose up -d --force-recreate nexus-preview nexus-backend
|
|
echo "==> Preview: http://localhost:8080"
|
|
echo "==> Backend WS: nexus-backend:8765"
|
|
exit 0
|
|
;;
|
|
esac
|
|
|
|
echo "==> Deploying $SERVICE …"
|
|
docker compose build "$SERVICE"
|
|
docker compose up -d --force-recreate "$SERVICE"
|
|
echo "==> Done. Container: $SERVICE"
|