{
  "app": "cancerindex",
  "label": "CancerIndex — The global index of cancer",
  "domain": "www.cancerindex.io",
  "port": 8250,
  "health_path": "/healthz",
  "dir": "~/apps/cancerindex",
  "extra_paths": [],
  "sync_excludes": [
    "node_modules/",
    ".next/",
    ".git/",
    ".env*",
    "data/raw/",
    "data/cache/",
    "logs/",
    "tmp/",
    "/coverage/",
    ".DS_Store",
    ".claude/",
    "apps/web/.next/"
  ],
  "requires": {
    "runtimes": [
      "pm2",
      "node",
      "pnpm",
      "postgresql@17"
    ],
    "ram_gb": 6,
    "ports": [
      8250,
      8251
    ]
  },
  "ram_mb_observed": 2500,
  "size_mb": 600,
  "placement": {
    "pin": null,
    "prefer": "M4M64b",
    "avoid": [
      "M3U96b",
      "M1M32"
    ],
    "reason": "M4M64b already runs Postgres 17 + pgvector, pnpm and redis with 772 GB of disk for the raw lake; M3U96b is reserved for hfmarketdata and M1M32 is the gateway."
  },
  "ngrok": null,
  "launchd": [],
  "env_overrides": {},
  "hooks": {
    "post_sync": [
      "pnpm install --frozen-lockfile",
      "psql -lqt | cut -d'|' -f1 | grep -qw cancerindex || createdb cancerindex",
      "psql cancerindex -c 'CREATE EXTENSION IF NOT EXISTS pg_trgm; CREATE EXTENSION IF NOT EXISTS unaccent; CREATE EXTENSION IF NOT EXISTS vector;'",
      "DATABASE_URL=postgres://localhost:5432/cancerindex pnpm db:migrate",
      "DATABASE_URL=postgres://localhost:5432/cancerindex pnpm db:seed",
      "DATABASE_URL=postgres://localhost:5432/cancerindex pnpm cix sources:sync",
      "mkdir -p data/raw data/cache logs",
      "NODE_ENV=production NEXT_TELEMETRY_DISABLED=1 NEXT_PUBLIC_SITE_URL=https://www.cancerindex.io CI_API_URL=http://127.0.0.1:8251 DATABASE_URL=postgres://localhost:5432/cancerindex pnpm --filter @cancerindex/web build"
    ],
    "post_start": [
      "sleep 5 && curl -fsS http://127.0.0.1:8251/healthz",
      "sleep 2 && curl -fsS http://127.0.0.1:8250/healthz || curl -fsS -o /dev/null http://127.0.0.1:8250/"
    ]
  },
  "ka_repo": null,
  "processes": [
    {
      "name": "cancerindex-web",
      "manager": "pm2",
      "script": "/opt/homebrew/bin/node",
      "args": [
        "node_modules/next/dist/bin/next",
        "start",
        "-p",
        "8250",
        "-H",
        "0.0.0.0"
      ],
      "interpreter": null,
      "cwd": "{{HOME}}/apps/cancerindex/apps/web",
      "env": {
        "NODE_ENV": "production",
        "DATABASE_URL": "postgres://localhost:5432/cancerindex",
        "NEXT_PUBLIC_SITE_URL": "https://www.cancerindex.io",
        "CI_API_URL": "http://127.0.0.1:8251",
        "API_PORT": "8251",
        "WEB_PORT": "8250",
        "CI_DATA_DIR": "{{HOME}}/apps/cancerindex/data",
        "ADMIN_TOKEN": "{{ADMIN_TOKEN}}",
        "NCBI_TOOL": "cancerindex",
        "NCBI_EMAIL": "spbou4@icloud.com",
        "NCBI_API_KEY": "",
        "SEER_API_KEY": "",
        "NEXT_TELEMETRY_DISABLED": "1"
      },
      "cron_restart": null,
      "autorestart": true,
      "max_memory_restart": "2G"
    },
    {
      "name": "cancerindex-api",
      "manager": "pm2",
      "script": "/opt/homebrew/bin/node",
      "args": [
        "node_modules/tsx/dist/cli.mjs",
        "apps/api/src/server.ts"
      ],
      "interpreter": null,
      "cwd": "{{HOME}}/apps/cancerindex",
      "env": {
        "NODE_ENV": "production",
        "CI_SERVICE": "api",
        "DATABASE_URL": "postgres://localhost:5432/cancerindex",
        "API_HOST": "127.0.0.1",
        "API_PORT": "8251",
        "WEB_PORT": "8250",
        "CI_API_URL": "http://127.0.0.1:8251",
        "NEXT_PUBLIC_SITE_URL": "https://www.cancerindex.io",
        "CI_DATA_DIR": "{{HOME}}/apps/cancerindex/data",
        "ADMIN_TOKEN": "{{ADMIN_TOKEN}}",
        "LOG_LEVEL": "info"
      },
      "cron_restart": null,
      "autorestart": true,
      "max_memory_restart": "1G"
    },
    {
      "name": "cancerindex-worker",
      "manager": "pm2",
      "script": "/opt/homebrew/bin/node",
      "args": [
        "node_modules/tsx/dist/cli.mjs",
        "workers/main.ts"
      ],
      "interpreter": null,
      "cwd": "{{HOME}}/apps/cancerindex",
      "env": {
        "NODE_ENV": "production",
        "CI_SERVICE": "worker",
        "DATABASE_URL": "postgres://localhost:5432/cancerindex",
        "CI_DATA_DIR": "{{HOME}}/apps/cancerindex/data",
        "WORKER_CONCURRENCY": "2",
        "CI_MAX_RUN_MINUTES": "45",
        "NCBI_TOOL": "cancerindex",
        "NCBI_EMAIL": "spbou4@icloud.com",
        "NCBI_API_KEY": "",
        "SEER_API_KEY": "",
        "LOG_LEVEL": "info"
      },
      "cron_restart": null,
      "autorestart": true,
      "max_memory_restart": "3G"
    },
    {
      "name": "cancerindex-backup",
      "manager": "pm2",
      "script": "/bin/bash",
      "args": [
        "deploy/backup.sh"
      ],
      "interpreter": null,
      "cwd": "{{HOME}}/apps/cancerindex",
      "env": {
        "DATABASE_URL": "postgres://localhost:5432/cancerindex",
        "BACKUP_DIR": "{{HOME}}/apps/cancerindex/backups",
        "LOG_DIR": "{{HOME}}/apps/cancerindex/logs",
        "KEEP_DAILY": "14",
        "KEEP_WEEKLY": "8",
        "PATH": "/opt/homebrew/opt/postgresql@17/bin:/opt/homebrew/bin:/usr/bin:/bin"
      },
      "cron_restart": "20 5 * * *",
      "autorestart": false,
      "max_memory_restart": null
    }
  ],
  "tunnel": {
    "domain": "www.cancerindex.io",
    "gateway": "BHS64",
    "note": "MacLustr Tunnel (WireGuard + Caddy on BHS64) since 2026-09-10; ngrok retired"
  }
}
