1. Clone Repository and Create Environment File
Clone the repository and copy the production environment template:2. Configure Production Environment Variables
Edit.env and set your production values:
3. Apply Prisma Database Migrations
Before serving live traffic, apply all pending Prisma schema migrations to your production PostgreSQL database:Important Database Migration Notes:
- What it does:
pnpm run db:deployrunsprisma migrate deployunder@instance/db. It applies pending migrations safely without resetting or dropping data. - Why
DIRECT_URLis mandatory: If using managed PostgreSQL providers with connection poolers (such as Neon or Supabase with PgBouncer in transaction mode), connection poolers cannot handle Prisma migration locks. Prisma automatically usesDIRECT_URL(direct unpooled connection) for schema migrations andDATABASE_URL(pooled connection) for runtime application queries. - Docker Compose Automation: When using the included
docker-compose.yml, thedb-migrateservice automatically executespnpm run db:deployand verifies completion before starting the API server and worker engine.
4. Configure Meta Webhooks for Production
Update your live webhook endpoint in the Meta Developer Console:- In your Meta App dashboard, navigate to the Configure Webhook section (or Webhooks -> Instagram).
- Update the Callback URL to point to your live production API endpoint:
https://api.yourdomain.com/api/webhook/instagram(Always include the/api/path prefix). - Enter your production Verify Token (matching
META_WEBHOOK_VERIFY_TOKEN). - Click Verify and Save.
- Ensure subscriptions are active for:
messages,messaging_postbacks,comments, andmessage_reactions.