CI/CD & DevOps Automation

Docker, GitHub Actions, Nginx—one instruction generate production config

DevOps config, tiap kali nightmare

YAML hell + environment inconsistent + config tune setengah hari

GitHub Actions YAML indent salah satu spasi, entire pipeline down. Error message cuma "syntax error", lo harus stare few hundred line YAML cari extra space itu.

"Lokal gw jalan bagus" — classic line. Docker image version salah, environment variable nggak pass, port mapping terbalik, deploy setiap kali adventure.

Nginx config copas dari internet, HTTPS cert nggak work, reverse proxy 502, access log semua 404. Folded tiga jam, ternyata proxy_pass kurang slash.

OpenClaw generate production-ready config buat lo

Bukan template asal-asalan, ini customize sesuai project lo

OpenClaw analyze project structure lo—pakai bahasa apa, framework apa, depend on service apa, need environment variable apa, terus generate targeted config.

Dockerfile yang di-generate bukan cuma pull latest image aja. Multi-stage build, image lean down, security best practice, semua lo consider.

GitHub Actions workflow juga nggak cuma jalanin npm test. Cache strategy, parallel task, conditional deploy, Secret manage, production perlu semua ada. Yang paling penting—YAML indent guaranteed correct.

DevOps Prompt, kopas langsung pake

Docker, CI/CD, Nginx tiga serangkai, semuanya production-ready.

Docker + docker-compose complete setup Golden instruction
Analyze project Node.js ini, generate complete Docker config:

Dockerfile requirement:
1. Multi-stage build (builder + production)
2. Pake Alpine base image, final image minimal
3. Run non-root user
4. Leverage cache layer effectively (COPY package.json dulu baru npm install)
5. Add healthcheck

docker-compose.yml requirement:
1. App service + database (PostgreSQL) + Redis
2. Differentiate dev dan prod environment (pake profile atau override file)
3. Volume data persistence
4. Network isolation
5. Environment variable manage pake .env file

Include .dockerignore plus explanation.
Config yang generate ini truly production-capable, bukan tutorial version yang FROM node:latest selesai. Multi-stage build bisa compress image dari 1GB ke under 100MB.
GitHub Actions CI/CD complete pipeline Golden instruction
Config complete GitHub Actions CI/CD pipeline buat project ini.

Workflow requirement:

1. CI (trigger setiap push dan PR):
   - Code check: ESLint / Prettier
   - Unit test + coverage report
   - Build verify
   - Dependency security scan

2. CD (trigger merge ke main):
   - Build Docker image push ke ECR
   - Deploy ke AWS ECS (atau EC2)
   - Post-deploy auto-run smoke test
   - Fail auto-rollback

3. Optimize:
   - npm/pip cache speed-up
   - Test parallelize
   - Only trigger relevant step pas relevant file change

Semua secret manage pake GitHub Secret.
Hand-write complete CI/CD config minimal setengah hari, plus repeated debug. Prompt ini one-time generate, mostly run-through just need change few variable.
Nginx reverse proxy + HTTPS + load balancing Advanced tips
Generate production-grade Nginx config:

1. Reverse proxy:
   - Frontend static resource (/) → local directory
   - API request (/api/) → backend service (upstream)
   - WebSocket support (/ws/)

2. HTTPS config:
   - Let's Encrypt certificate (Certbot auto-renew)
   - HTTP auto-redirect HTTPS
   - HSTS, OCSP Stapling
   - TLS 1.2+ only, secure cipher suite

3. Load balancing:
   - Upstream multiple backend instance
   - Health check
   - least_conn strategy

4. Performance optimize:
   - Gzip compression
   - Static resource cache header
   - Request rate limit (prevent DDoS)

Include Certbot install command sama cert request.
Nginx config paling mudah jadi aneh. proxy_pass ending slash perlu apa nggak, location match priority, upstream health check—semua gotcha ini AI sudah avoid.

Config generate: OpenClaw vs hand-write YAML

Bukan bilang hand-write nggak bagus, tapi ada smarter way.

OpenClaw
  • Customize config based on project structure, bukan generic template
  • Include security best practice (non-root, Secret manage, TLS config)
  • Generate YAML format guaranteed correct, nggak indent error
  • One Prompt handle semua, Docker + CI/CD + Nginx
VS
Hand-write YAML / internet copy
  • Copy dari Stack Overflow, version mungkin already outdated
  • Security config often miss, discover pas launch dah jadi security issue
  • YAML indent tune setengah hari, satu spasi destroy everything
  • Frankenstein config, pieces might conflict each other

Real scenario: fresh project DevOps setup from zero

Fresh project need launch, DevOps cuma lo sendirian
Backend Node.js + PostgreSQL + Redis, frontend React, butuh Docker container, GitHub Actions CI/CD, Nginx reverse proxy, HTTPS. Boss bilang one week finish.
OpenClaw
Tiga Prompt selesai, Docker complete, CI/CD pipeline, Nginx config semuanya ready. Spend half day modify few project-specific variable, run test. Next day start deploy test environment, less than one week done.
Yourself from scratch
Just Docker multi-stage build research two day, GitHub Actions cache config tune one day, Nginx HTTPS config stress sampai midnight. One week gone, still debug CI error. Boss start ask progress.

DevOps config tips

💡 After generate config, test locally dulu. Docker pake docker-compose up --build test, GitHub Actions pake act simulate locally.
🎯 Suruh OpenClaw add detailed comment di config. Tiga bulan kemudian lo modify, lo bakal grateful past-self add comment.
⚠️ Config generate yang involve secret/password, pastiin pake environment variable atau Secret manage. Never hardcode secret ke config file. This is law.
Case ini membantu kamu?