Files
satusehat-worker/docs/deployment.md
T
2026-08-05 06:47:59 +00:00

50 lines
1.3 KiB
Markdown

# 🚀 Deployment Guide
Dokumen ini memuat panduan untuk men-*deploy* aplikasi **GoPrint Service General** di lingkungan *Staging* maupun *Production*.
## 1. Prerequisites
Pastikan infrastruktur/server telah memiliki:
* **Go** versi 1.21 atau lebih tinggi.
* **PostgreSQL / MySQL** (sebagai *Primary Database*).
* **Redis** (untuk mekanisme *Caching*).
* **MinIO / AWS S3** (Opsional, untuk penyimpanan berkas).
* Akses jaringan keluar (Koneksi ke `https://apijkn.bpjs-kesehatan.go.id` dan `https://api-satusehat.kemkes.go.id`).
## 2. Configuration (`config.yaml`)
Aplikasi menggunakan Viper untuk memuat konfigurasi. Siapkan `config.yaml` di *root* proyek. Beberapa nilai kunci yang harus disiapkan:
```yaml
server:
mode: "production" # development | production
rest:
enabled: true
port: 8080
grpc:
enabled: true
port: 9090
databases:
default:
type: "postgres"
host: "localhost"
port: 5432
database: "simrs_db"
username: "postgres"
password: "securepassword"
cache:
enabled: true
redis:
host: "localhost"
port: 6379
```
## 3. Build & Run (Bare-Metal)
```bash
# Build binary
go build -o service-general ./cmd/api/main.go
# Jalankan sebagai background process atau Service (systemd)
./service-general
```