# Shareable stack: ThreeHats rest-api relay + browser-served Obsidian. # # Brings up the two containers the sync tool needs alongside an EXTERNAL Foundry # instance (you supply FOUNDRY_URL — Foundry itself is not bundled; it needs a # license + the rest-api module installed). The sync tool itself stays host-run # (./sync.sh ui) so it can read the journal LevelDB and shell out to `docker`. # # Copy .env.example -> .env and fill it in, or run the /setup skill which does it # for you. Then: docker compose up -d # # NOTE on networking: Foundry's rest-api module connects OUT to the relay over # WebSocket. If your Foundry is on a different host than this compose, the relay's # port (RELAY_PORT) must be reachable from Foundry (port-forward / tailnet / public # domain). RELAY_URL below is what the *tool* calls (usually localhost). services: relay: # Pin to a release tag (e.g. :2.1.0) for production stability. image: threehats/foundryvtt-rest-api-relay:latest container_name: ${RELAY_CONTAINER:-foundry-rest-api-relay} environment: - DB_TYPE=sqlite - APP_ENV=production - ALLOW_HEADLESS=true - PORT=3010 - HEADLESS_SESSION_TIMEOUT=${HEADLESS_SESSION_TIMEOUT:-3600} - FRONTEND_URL=${RELAY_FRONTEND_URL:-http://localhost:3010} volumes: - ./relay-data:/app/data ports: - "${RELAY_PORT:-3010}:3010" # Headless Chrome (Puppeteer) needs a sizable /dev/shm to avoid crashes. shm_size: "1g" restart: unless-stopped # Optional GPU-accelerated relay for hosts with a /dev/dri device. Software # rendering (the default `relay` service above) works without it, just slower. # Enable with: docker compose --profile gpu up -d relay-gpu relay-gpu: image: threehats/foundryvtt-rest-api-relay:latest container_name: ${RELAY_CONTAINER:-foundry-rest-api-relay}-gpu profiles: ["gpu"] environment: - DB_TYPE=sqlite - APP_ENV=production - ALLOW_HEADLESS=true - PORT=3010 - HEADLESS_SESSION_TIMEOUT=${HEADLESS_SESSION_TIMEOUT:-3600} - FRONTEND_URL=${RELAY_FRONTEND_URL:-http://localhost:3010} - CHROME_GPU_MODE=gpu - CAPTURE_BROWSER_CONSOLE=error volumes: - ./relay-data:/app/data ports: - "${RELAY_PORT:-3010}:3010" devices: - /dev/dri:/dev/dri shm_size: "1g" restart: unless-stopped