Deploy Static Website¶
π Get Started¶
Setelah website statis berhasil dibangun, langkah berikutnya adalah mempublikasikannya agar dapat diakses oleh pengguna.
Pada panduan ini, website dijalankan menggunakan NGINX Container sebagai runtime. Konten website dipisahkan dari container image sehingga perubahan dokumentasi tidak memerlukan proses build image kembali.
Pendekatan ini membuat deployment lebih sederhana, fleksibel, dan mudah diotomatisasi.
π― Learning Objectives¶
Setelah menyelesaikan panduan ini, Anda akan mampu:
- Memahami arsitektur deployment website statis.
- Menyiapkan website untuk deployment.
- Menjalankan website menggunakan NGINX Container.
- Memverifikasi hasil deployment.
π Workflow¶
flowchart LR
A["Static Website"]
--> B["Deployment Directory"]
B --> C["NGINX Container"]
C --> D["Web Browser"]
π Prerequisites¶
Pastikan:
| Component | Description |
|---|---|
| Static Website | Successfully built |
| Deployment Repository | Available |
| nginx-image | Available |
| Podman | Installed |
βΆοΈ Procedure¶
Review the Static Website¶
Pastikan proses build telah menghasilkan direktori berikut.
Direktori tersebut berisi seluruh file website yang akan dipublikasikan.
Synchronize the Deployment Directory¶
Salin hasil build ke deployment repository.
Contoh struktur deployment.
Review the Deployment Configuration¶
Pastikan lokasi website telah dikonfigurasi.
Parameter:
| Parameter | Description |
|---|---|
| IMAGE_NAME | Runtime image |
| WEB_ROOT | Static website location |
Start the Container¶
Jalankan deployment.
Container akan melakukan bind mount.
NGINX akan menyajikan seluruh file pada direktori tersebut.
β Verification¶
Pastikan container berjalan.
Pastikan bind mount berhasil.
Pastikan document root berisi website.
Akses website.
Verification
Deployment dinyatakan berhasil apabila:
- Container berhasil dijalankan.
- Static website berhasil di-mount.
- File
index.htmltersedia. - Website dapat diakses melalui browser.
π‘ Technology Notes¶
- Pisahkan source documentation dan deployment.
- Gunakan runtime image yang bersifat generik.
- Jangan menyimpan source Markdown pada deployment repository.
- Website yang dipublikasikan hanya berasal dari hasil proses build.
βΆοΈ Next Steps¶
Website sekarang telah berhasil dipublikasikan.
Pada bab berikutnya akan dibahas berbagai permasalahan umum beserta langkah penyelesaiannya.
π Related Documents¶
| Document | Description |
|---|---|
| Build Website | Generate the static website |
| Troubleshooting | Resolve common deployment issues |
π External References¶
π Summary¶
Pada panduan ini Anda telah mempelajari cara:
- Menyiapkan website untuk deployment.
- Menyalin hasil build ke deployment repository.
- Menjalankan website menggunakan NGINX Container.
- Memverifikasi hasil deployment.
Website sekarang telah berhasil dipublikasikan dan siap diakses melalui web browser.