EMTB Production Deployment Checklist
Project: EMTB Consulting Platform Environment: Production (Dokploy) Last Updated: 2025-11-23
Pre-Deployment Checklist​
✅ Code Quality​
- All tests passing locally (
pnpm run test) - TypeScript compilation successful (
pnpm run type:check) - Build successful locally (
pnpm run build) - No ESLint errors
- Code reviewed (if applicable)
✅ Git​
- All changes committed
- Meaningful commit message
- Pushed to
mainbranch - No uncommitted files
✅ Environment Variables​
- All required env vars set in Dokploy
- Database credentials verified
- JWT secrets configured
- API URLs correct
- Email service (Brevo) configured
✅ Database​
- Migrations reviewed
- Backup created (if needed)
- No destructive migrations without confirmation
Deployment Process​
Step 1: Trigger Deployment​
- Navigate to Dokploy dashboard
- Select API or Frontend application
- Click "Deploy" or wait for auto-deploy
Step 2: Monitor Deployment​
- Watch build logs in Dokploy
- Check for build errors
- Monitor health checks
- Watch for container status:
healthy
Step 3: Verify Health Checks​
- API health check passing:
/health - Frontend health check passing:
/health - Container status shows "healthy"
- No restart loops
Step 4: Test Application​
- Open https://app.emtb.consulting
- Test login functionality
- Test main features
- Check browser console for errors
- Test on mobile (responsive)
Post-Deployment Verification​
✅ Functional Testing​
- Authentication: Sign in/out works
- Dashboard: Loads correctly
- Clients: List, view, create, edit
- Sites: List, view, create, edit
- Reclamations: List, view, create, edit
- Users (Admin): List, create, edit
- Password Reset: Forgot password flow
✅ Performance​
- Page load times acceptable (<3s)
- API responses fast (<500ms)
- No console errors
- No memory leaks (check container stats)
✅ Security​
- HTTPS working correctly
- No mixed content warnings
- CORS configured properly
- Authentication required for protected routes
Zero Downtime Deployment Verification​
During Deployment​
- Open app in browser
- Continuously refresh during deployment
- Expected: No 502 Bad Gateway errors
- Expected: Continuous availability
- Expected: Smooth transition
Health Check Status​
- New containers start alongside old ones
- Health checks run successfully
- Traffic switches after health verification
- Old containers stop gracefully
Rollback Procedure​
If Deployment Fails​
Option 1: Automatic Rollback​
- Dokploy automatically rolls back if health checks fail
- Monitor logs to see rollback in progress
Option 2: Manual Rollback​
- Go to Dokploy dashboard
- Navigate to application
- Click "Rollbacks" tab
- Select previous working version
- Click "Rollback to this version"
- Monitor deployment
Option 3: Git Revert​
# Find commit to revert
git log --oneline -5
# Revert specific commit
git revert <commit-hash>
# Push to trigger new deployment
git push
Common Issues & Solutions​
Issue: 502 Bad Gateway After Deployment​
Cause: Zero downtime not configured
Solution:
- See
dokploy-zero-downtime-setup.md - Configure Swarm health checks
- Enable
start-firstorder
Issue: Container Keeps Restarting​
Possible Causes:
- Health check failing
- Application crash on startup
- Missing environment variables
- Database connection issues
Investigation Steps:
- Check container logs in Dokploy
- Look for error messages
- Verify environment variables
- Check database connectivity
- Review recent code changes
Issue: Build Fails​
Possible Causes:
- TypeScript errors
- Missing dependencies
- Build configuration issues
- Out of memory during build
Investigation Steps:
- Check build logs in Dokploy
- Run build locally:
pnpm run build - Check for TypeScript errors
- Verify dependencies installed
- Check for memory issues on server
Issue: Health Check Failing​
Possible Causes:
/healthendpoint not responding- Port mismatch
- Container not fully started
- Application error
Investigation Steps:
# Test health endpoint from inside container
docker exec -it emtb-api wget --spider http://localhost:3001/health
docker exec -it emtb-frontend curl -f http://localhost/health
Solution:
- Check application logs
- Verify health endpoint implementation
- Increase
StartPeriodif needed - Check for application errors
Issue: Database Migration Fails​
Possible Causes:
- Destructive migration
- Constraint violations
- Missing rollback strategy
Investigation Steps:
- Check migration logs
- Review migration SQL
- Check database state
Solution:
- Create database backup
- Test migration locally first
- Use safer migration strategies
- Add proper error handling
Performance Monitoring​
Metrics to Monitor​
- Container CPU usage (<70%)
- Container memory usage (<80%)
- Response times (<500ms)
- Error rates (<1%)
- Health check success rate (100%)
Dokploy Monitoring​
- Go to application in Dokploy
- Check "Metrics" or "Stats" tab
- Monitor resource usage
- Watch for anomalies
Deployment Schedule​
Recommended Deployment Times​
- Best: Off-peak hours (weekends, evenings)
- Avoid: Business hours (9 AM - 5 PM)
- Plan: Major releases during maintenance windows
Deployment Frequency​
- Hotfixes: As needed
- Features: Weekly or bi-weekly
- Major releases: Monthly
Emergency Contacts​
Technical Support​
- Dokploy Issues: https://github.com/Dokploy/dokploy/issues
- Documentation: https://docs.dokploy.com
Team Contacts​
- DevOps: [Your contact]
- Backend Lead: [Your contact]
- Frontend Lead: [Your contact]
Deployment Log Template​
## Deployment: YYYY-MM-DD HH:MM
**Deployed By:** [Name]
**Commit:** [commit hash]
**Changes:** [Brief description]
### Pre-Deployment
- [ ] Tests passed
- [ ] Build successful
- [ ] Environment verified
### Deployment
- [ ] Triggered at: [time]
- [ ] Completed at: [time]
- [ ] Duration: [minutes]
### Verification
- [ ] Application accessible
- [ ] Features tested
- [ ] No errors
### Issues
- [Any issues encountered]
### Rollback (if needed)
- [Rollback steps taken]
### Notes
- [Additional notes]
Quick Command Reference​
Build & Test Locally​
# Install dependencies
pnpm install
# Run tests
pnpm run test
# Type check
pnpm run type:check
# Build
pnpm run build
# Build specific app
pnpm run build --filter=api
pnpm run build --filter=frontend
Git Commands​
# Check status
git status
# Commit changes
git add .
git commit -m "feat: description"
# Push to remote
git push
# View recent commits
git log --oneline -10
Docker Commands (on server)​
# View running containers
docker ps
# View logs
docker logs emtb-api
docker logs emtb-frontend
# Execute command in container
docker exec -it emtb-api sh
# Check health
docker inspect emtb-api | grep Health
End of Checklist