mac-membership-verify ships as a single app container (SPA + API) plus Postgres,
defined in docker-compose.yml. This mirrors the rest of
the MAC Suite (spec §3): Dokploy compose stack on the Oracle VM.
- A DNS record for
verify.monashcoding.compointing at the Oracle VM.- The app must be served under
*.monashcoding.com. mac-auth sets its session cookie on.monashcoding.comand trusts that origin — an off-domain host would need adding to mac-auth'sTRUSTED_ORIGINS(avoid this).
- The app must be served under
- Dokploy running on the VM, with access to this GitHub repo.
In Dokploy:
- Create → Compose, provider GitHub, repo
monashcoding/verification, branchmain, compose pathdocker-compose.yml. - Save. Don't deploy yet — set the environment first.
| Variable | Required | Notes |
|---|---|---|
CODE_SECRET |
yes | Long random string. Discount codes are derived from it; changing it later changes every code. Compose refuses to start without it. |
POSTGRES_PASSWORD |
recommended | Postgres password (also used in DATABASE_URL). Defaults to the project name if unset — set a real one in prod. |
DISCORD_WEBHOOK_URL |
optional | Where code batches are posted (§9). Unset → the cron just logs. |
HUMANITIX_API_KEY |
optional | Read-only key (Humanitix → Settings → API Keys) so the admin lists live events automatically. Unset → manual event entry only. |
AUTH_URL |
optional | Defaults to https://auth.monashcoding.com. |
JWT_AUDIENCE |
optional | Defaults to mac-suite. |
MAC_ADMIN_ROLES |
optional | Defaults to exec,committee. |
VITE_AUTH_URL |
optional | Build-time; baked into the SPA. Defaults to the prod auth URL. |
Add a domain in Dokploy: host verify.monashcoding.com, container port 3000,
HTTPS on (Let's Encrypt). Dokploy's Traefik routes the domain to the app container.
Hit Deploy. On container start the entrypoint applies Drizzle migrations
(docker-entrypoint.sh → dist/server/db/migrate.js) before serving, so the
schema is created/updated automatically. No manual migration step.
Dokploy → the service → Deployments / Git → enable "Auto Deploy." Dokploy
registers a webhook on the GitHub repo so every push to main triggers a rebuild
and redeploy.
If you'd rather wire it by hand: copy the service's Webhook URL from Dokploy
and add it under GitHub repo Settings → Webhooks (content type
application/json, event: push).
Provisioning for newly-published events fires automatically (Trigger A, when an event is created/activated via the admin API). The daily catch-up for members who link after an event's first batch is a separate scheduled run:
Dokploy → Schedules / Cron → new task against the app service:
node dist/server/codes/run-daily-diff.js
Daily (e.g. 0 9 * * *) is plenty — stragglers aren't urgent (§10).
# Health (no auth):
curl -s https://verify.monashcoding.com/api/health
# → {"ok":true,"service":"mac-membership-verify"}Then a manual end-to-end: open https://verify.monashcoding.com/, sign in, and
confirm the account chooser appears (mac-auth prompt=select_account). Admin
routes require an exec/committee mac-auth token.