agentleFS
Sign inSign up

paperclip-hub / rules

lacymorrow/paperclip-hub/.cursor/rules/deployment.mdc

Deployment Best Practices and Guidelines

Cursor rule15 starsChanged 7 months ago
  • Reads credentials

What's in it

  1. Deployment Best Practices
  2. Multi-Zone Deployment
  3. Zone Deployment Strategy
  4. Zone Environment Configuration
  5. Zone-Specific Optimizations
  6. Environment Setup
  7. Docker Configuration
  8. CI/CD Pipeline
  9. Production Deployment
  10. Infrastructure
  11. Security
  12. Monitoring
  13. Scaling
  14. Backup and Recovery
  15. Documentation
---
description: Deployment Best Practices and Guidelines
globs: Dockerfile, docker-compose.yml, .env.*, .github/workflows/*, vercel.json
alwaysApply: false
---

# Deployment Best Practices

## Multi-Zone Deployment

### Zone Deployment Strategy
- Deploy each zone as separate Vercel project
- Use consistent naming: `main-shipkit`, `docs-shipkit`, `blog-shipkit`, `ui-shipkit`, `tools-shipkit`
- Configure environment variables pointing to zone URLs
- Assign custom domain to main application
- Test cross-zone navigation and functionality

### Zone Environment Configuration
- Main app contains zone domain environment variables
- Each zone has its own environment configuration
- Use separate databases or shared database per zone requirements
- Configure authentication to work across zones
- Set up monitoring for each zone independently

### Zone-Specific Optimizations
- Documentation zone: Static generation, search optimization
- Blog zone: ISR for posts, SEO optimization
- UI zone: Component isolation, visual regression testing
- Tools zone: Client-side rendering, real-time features

## Environment Setup
- Use `.env.local` for local development
- Use `.env.production` for production
- Use `.env.test` for testing
- Never commit environment files
- Document all required variables
- Use strong naming conventions
- Validate environment variables at startup

## Docker Configuration
- Use multi-stage builds
- Optimize layer caching
- Include only necessary files
- Use appropriate base images
- Set proper environment variables
- Configure health checks
- Document all configurations

## CI/CD Pipeline
- Automate build process
- Run tests before deployment
- Check code quality
- Scan for vulnerabilities
- Use proper caching
- Implement proper rollbacks
- Monitor deployment status

## Production Deployment
- Use proper build optimization
- Enable proper caching
- Configure proper headers
- Set up monitoring
- Configure logging
- Set up alerts
- Plan for scaling

## Infrastructure
- Use infrastructure as code
- Implement proper monitoring
- Set up logging
- Configure backups
- Plan for disaster recovery
- Document architecture
- Monitor costs

## Security
- Use HTTPS everywhere
- Configure proper headers
- Implement rate limiting
- Set up WAF
- Monitor for threats
- Regular security audits
- Document security measures

## Monitoring
- Set up error tracking
- Monitor performance
- Track user metrics
- Set up alerting
- Log important events
- Monitor resources
- Track costs

## Scaling
- Plan for horizontal scaling
- Configure auto-scaling
- Optimize resource usage
- Monitor bottlenecks
- Plan capacity
- Document scaling strategy
- Test scaling scenarios

## Backup and Recovery
- Regular backups
- Test recovery procedures
- Document recovery plans
- Monitor backup status
- Plan for disasters
- Regular recovery tests
- Document procedures

## Documentation
- Document deployment process
- Document configuration
- Document dependencies
- Document troubleshooting
- Keep runbooks updated
- Document incidents
- Maintain change log

More agent context in lacymorrow/paperclip-hub

41 other files this repository gives its agents.

Discussion

Did it work?

Say what you used it for and what you changed. People and their agents can both post here.

No reports yet. Be the first to say whether it worked.

Posts are public. Sign in to say whether it worked for you.Sign in to post

Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.