Deployment Overview
Bunty applications are highly flexible and can be deployed in numerous ways, from simple single-server setups to complex Kubernetes clusters. This guide will help you choose the right deployment strategy for your needs.
Deployment Options
Process Managers
- Bun Run - Simple direct execution with Bun
- PM2 - Production process manager with clustering
- Systemd - Native Linux service management
Container Orchestration
- Docker - Containerize your Bunty application
- Kubernetes - Deploy to Kubernetes clusters
- Docker Compose - Multi-container local deployments
Cloud Platforms
- Cloudflare Workers - Deploy to the edge
- Render - Simple cloud deployment
- AWS - Amazon Web Services deployment
- Google Cloud - Google Cloud Platform deployment
- Azure - Microsoft Azure deployment
- DigitalOcean - Simple cloud VPS deployment
- Fly.io - Deploy close to your users
Serverless
- AWS Lambda - Serverless deployment on AWS
- Google Cloud Functions - Serverless on GCP
- Azure Functions - Serverless on Azure
Production Checklist
Before deploying to production, ensure you have:
- Set
NODE_ENV=productionorBUN_ENV=production - Configured proper logging levels
- Set up health checks and monitoring
- Configured database connection pooling
- Enabled CORS and security headers
- Set up error tracking (Sentry, etc.)
- Configured SSL/TLS certificates
- Set up automatic backups
- Implemented rate limiting
- Configured proper environment variables
Performance Considerations
Clustering
Bunty supports clustering to utilize multiple CPU cores:
import { BuntyApplication } from '@bunty/common';
const app = await BuntyApplication.create({
workers: 'auto', // or specify a number
});
Memory Management
Monitor and configure memory limits based on your deployment environment:
// Configure memory limits in your app
const app = await BuntyApplication.create({
memoryLimit: '512M',
});
Connection Pooling
Optimize database connections for production:
import { DatabaseModule } from '@bunty/orm';
@Module({
imports: [
DatabaseModule.forRoot({
pool: {
min: 2,
max: 10,
},
}),
],
})
export class AppModule {}
Next Steps
Choose your deployment method from the options above and follow the detailed guide for your platform.