Repository navigation
Expand file tree
/
Copy pathrender.yaml
More file actions
77 lines (73 loc) · 3.51 KB
/
Copy pathrender.yaml
File metadata and controls
77 lines (73 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Render Blueprint (Infrastructure as Code)
# Dokumentasi: https://render.com/docs/blueprint-spec
databases:
# PostgreSQL Database (pgvector didukung secara default di Render Postgres 14/15/16)
- name: gradia-db
plan: free # Free Postgres di Render otomatis expire 90 hari - upgrade sebelum itu untuk data permanen
databaseName: gradia_prod_db
user: gradia_admin
postgresMajorVersion: "15"
services:
# Redis / Key Value Cache
- name: gradia-redis
type: keyvalue
plan: free
ipAllowList: [] # Accessible internally only
# Backend (FastAPI Web Service)
- name: gradia-backend
type: web
runtime: python
buildCommand: "pip install -r backend/requirements.txt"
startCommand: "uvicorn backend.app.main:app --host 0.0.0.0 --port $PORT"
plan: free # Free web service tidur setelah 15 menit idle (cold start ~30-50 detik)
envVars:
- key: PYTHONPATH
value: "."
- key: PYTHON_VERSION
value: "3.11.9" # Pin ke versi stabil - versi terlalu baru bisa gagal build karena dependency belum punya wheel prebuilt
- key: DATABASE_URL
fromDatabase:
name: gradia-db
property: connectionString
- key: REDIS_URL
fromService:
name: gradia-redis
type: keyvalue
property: connectionString
- key: JWT_SECRET
generateValue: true
- key: AFFILIATE_POSTBACK_SECRET
generateValue: true # Auto-generated oleh Render. Salin nilainya (Render Dashboard) ke pengaturan Postback URL di dashboard affiliate network Anda (Shopee Affiliate/Involve Asia/dst): GET /api/v1/affiliate/postback?link_id=...&amount=...&secret=<nilai-ini>
- key: DOMAIN_NAME
sync: false # Isi dengan domain asli Anda di Render Dashboard (mis. contoh.com)
- key: GEMINI_API_KEY
sync: false # Admin akan mengisi ini di Render Dashboard
- key: RESEND_API_KEY
sync: false # Isi dengan API key dari akun Resend yang sudah tersambung (lihat memory project_manual_setup_checklist) - sudah dibuat 1 key bernama "Gradia Backend"
- key: RESEND_FROM_EMAIL
sync: false # Opsional - default "Gradia <onboarding@resend.dev>" (sandbox, langsung jalan tanpa verifikasi domain). Ganti begitu domain Gradia sudah ditambahkan & verified di Resend.
- key: GOOGLE_CLIENT_ID
sync: false
- key: GOOGLE_CLIENT_SECRET
sync: false # Tidak dipakai backend saat ini (login Google pakai verifikasi id_token, cukup client_id) - aman dikosongkan
- key: GCS_BUCKET_NAME
sync: false # WAJIB diisi bucket GCS asli - kalau kosong, upload dokumen mahasiswa DIAM-DIAM jatuh ke mock URL palsu (lihat backend/app/shared/infrastructure/storage.py)
- key: GOOGLE_APPLICATION_CREDENTIALS
sync: false # Path/JSON service account GCP untuk akses GCS - tanpa ini, upload_file_to_gcs() gagal lalu diam-diam fallback ke URL palsu
- key: SENTRY_DSN
sync: false # Opsional tapi disarankan - tanpa ini error production tidak terlacak di Sentry sama sekali
- key: ADMIN_WA_NUMBER
sync: false
# Frontend (React Static Site)
- name: gradia-frontend-static
type: web
runtime: static
buildCommand: "cd frontend && npm install && npm run build"
staticPublishPath: "frontend/dist"
envVars:
- key: VITE_API_URL
sync: false # Isi manual dengan URL backend setelah deploy pertama (mis. https://gradia-backend.onrender.com/api/v1), atau subdomain custom Anda
routes:
- type: rewrite
source: /*
destination: /index.html