Deployment
Markup can be deployed as a standard Next.js application using platforms such as:- Vercel
- Docker
- VPS / Dedicated Servers
- Railway
- Coolify
- Render
- PostgreSQL database
- Environment variables configured
- Prisma migrations applied
Production Requirements
Before deployment, ensure you have:- Node.js 18+
- PostgreSQL database
- WorkOS application configured
- Production environment variables configured
- HTTPS enabled for authentication callbacks
Required Environment Variables
Example production configuration:Build the Application
Install dependencies:Database Migrations
Run Prisma migrations before starting production deployments:Deploying to Vercel
1. Push Repository to GitHub
Ensure your repository is committed and pushed.2. Import Project into Vercel
- Open the Vercel dashboard
- Import the GitHub repository
- Select the project
- Configure environment variables
3. Configure Environment Variables
Add all required variables from.env.local into:
4. Configure PostgreSQL
You can use:- Neon
- Supabase
- Railway PostgreSQL
- Vercel Postgres
- Self-hosted PostgreSQL
5. Deploy
Vercel automatically runs:Deploying with Docker
Docker Compose
Dockerfile
Deploying on a VPS
Clone the Repository
Install Dependencies
Configure Environment Variables
Create:Generate Prisma Client
Run Migrations
Build Application
Start Server
Reverse Proxy Example (Nginx)
Recommended Production Setup
Recommended stack:- Next.js application
- PostgreSQL database
- Nginx reverse proxy
- HTTPS via Let’s Encrypt
- PM2 or Docker for process management
PM2 Example
Install PM2:Updating Production Deployments
Pull latest changes:Security Recommendations
- Use HTTPS in production
- Enable PostgreSQL SSL
- Restrict database access
- Never expose
.envfiles publicly - Use strong secrets
- Rotate API keys periodically
- Enable automatic backups
Troubleshooting
Prisma Migration Failures
Check migration status:Application Fails to Start
Verify:- Environment variables exist
- Database is reachable
- Prisma client is generated
- Build completed successfully
WorkOS Authentication Errors
Ensure:- Redirect URI matches production domain
- HTTPS is enabled
- Callback URLs are configured in WorkOS
Deployment Checklist
- Environment variables configured
- PostgreSQL database running
- Prisma migrations applied
- HTTPS enabled
- WorkOS redirect URI configured
- Application successfully built
- Backups configured
- Monitoring/logging enabled