CI/CD और DevOps Automation
Docker, GitHub Actions, Nginx — एक instruction से production-level configuration
DevOps configuration, हर बार एक nightmare होता है
GitHub Actions के YAML में एक space गलत, सारा pipeline crash हो गया। Error message सिर्फ "syntax error", तुम सैकड़ों lines के YAML को stare करते हो अलग space को find करने के लिए।
"मेरे local में perfectly काम कर रहा है" — classic line। Docker image version गलत, environment variables pass नहीं हुए, port mapping reverse हो गई, हर deploy एक adventure बन जाता है।
Nginx configuration को internet से copy किया, HTTPS काम नहीं कर रहा, reverse proxy 502 दे रहा है, access log में सब 404 है। 3 hours खोज के पता चला कि proxy_pass में एक slash गायब है।
OpenClaw तुम्हारे लिए production-level configuration generate कर
OpenClaw तुम्हारी project structure को analyze करता है — कौन सी language, कौन सी framework, कौन से services, कौन से environment variables, फिर targeted configuration generate करता है।
Generated Dockerfile latest image को randomly pull नहीं करता। Multi-stage builds, image optimization, security best practices — सब को consider किया हुआ होता है।
GitHub Actions workflow भी सिर्फ npm test नहीं चलाता। Cache strategy, parallel tasks, conditional deployments, Secret management — production को जो चाहिए सब है। सबसे important — generated YAML का syntax बिल्कुल सही होता है।
DevOps Prompts, सीधे copy कर सकते हो
Docker, CI/CD, Nginx — तीन main चीज़ें, हर एक production-level configuration है।
इस Node.js project को analyze करके complete Docker configuration generate करो:
Dockerfile requirements:
1. Multi-stage builds (builder + production)
2. Alpine base image use करो, final image छोटी हो
3. Non-root user से run करो
4. Cache को properly use करो (पहले package.json COPY करो फिर npm install)
5. Healthcheck add करो
docker-compose.yml requirements:
1. App service + database (PostgreSQL) + Redis
2. Dev और prod environments को separate करो (profiles या override files से)
3. Data persistence के लिए volumes
4. Network isolation
5. Environment variables को .env से manage करो
.dockerignore और necessary documentation के साथ।
इस project के लिए complete GitHub Actions CI/CD pipeline configure करो।
Workflow requirements:
1. CI (every push और PR पर trigger):
- Code linting: ESLint / Prettier
- Unit tests + coverage report
- Build validation
- Dependency security scan
2. CD (main में merge पर trigger):
- Docker image build करके ECR में push करो
- AWS ECS में (या EC2 में) deploy करो
- Deploy के बाद smoke tests run करो
- Failure पर auto-rollback करो
3. Optimization:
- npm/pip caching से speed बढ़ा
- Tests को parallel करो
- Relevant file changes पर ही specific steps trigger करो
सभी secrets को GitHub Secrets से manage करो।
Production-level Nginx configuration generate करो:
1. Reverse proxy:
- Frontend static assets (/) → local directory
- API requests (/api/) → backend service (upstream)
- WebSocket support (/ws/)
2. HTTPS configuration:
- Let's Encrypt certificate (Certbot auto-renewal)
- HTTP को HTTPS पर auto-redirect करो
- HSTS, OCSP Stapling
- TLS 1.2+ only, secure cipher suites
3. Load balancing:
- Upstream में multiple backend instances
- Health checks
- Least_conn strategy
4. Performance optimization:
- Gzip compression
- Static asset caching headers
- Request rate limiting (DDoS protection)
Certbot installation और certificate request commands के साथ।
Configuration generation: OpenClaw vs hand-written YAML
Hand-written गलत नहीं है, लेकिन smarter तरीका है।
- Project structure के हिसाब से customize करता है, generic template नहीं
- Security best practices को include करता है (non-root, Secret management, TLS)
- Generated YAML का syntax guaranteed सही है, कोई space mismatch नहीं
- एक Prompt से पूरा सब: Docker + CI/CD + Nginx
- Stack Overflow से copy किया तो version पुराना हो सकता है
- Security config अक्सर miss हो जाता है, production में holes।
- YAML spaces को adjust करने में hours लग जाते हैं
- अलग-अलग से पिस किया गया code, अलग-अलग conflict हो सकते हैं