📖 Konsep Utama Deployment
- Server Hosting: tempat aplikasi dijalankan (VPS, cloud, shared hosting).
- Build & Bundle: mengoptimalkan kode (minify, transpile, bundle).
- Environment Variables: konfigurasi rahasia (API key, DB password) tidak disimpan di kode.
- CI/CD: otomatisasi build, test, dan deploy (GitHub Actions, GitLab CI, Jenkins).
- Scaling: menambah kapasitas server saat trafik meningkat.
🔹 Contoh Deployment Node.js ke VPS
# 1. Clone project
git clone https://github.com/user/proyek.git
cd proyek
# 2. Install dependency
npm install
# 3. Jalankan aplikasi
node app.js
# 4. Gunakan PM2 agar tetap jalan di background
npm install -g pm2
pm2 start app.js
🔹 Deployment ke Platform Cloud
- Heroku: mudah untuk pemula, push via Git.
- Vercel/Netlify: cocok untuk frontend (React, Vue, Next.js).
- AWS/GCP/Azure: enterprise-level, fleksibel, mendukung scaling otomatis.