docs: Docker run instructions, env table, and compose deploy topology

This commit is contained in:
Bkk1234 committed 2026-11-23 01:57:25 +07:00
1 parent af19d04496
commit 22fdd37869
3 files changed
+62 -8

No files matched your search

+17
View File
@@ -47,6 +47,23 @@ node --test tests/*.test.mjs
- สคีมา DB: `service/db/001_init.sql` · สัญญา API: `service/openapi.yaml`
- ห้าม commit `service/.env` (มีรหัส DB)
### Docker (web + API + PostgreSQL) — พอร์ตมาจาก `.env`
```bash
cp .env.example .env # ตั้ง DB_PASSWORD ก่อน (compose ไม่ start ถ้าว่าง)
docker compose build # ครั้งแรก ~5 นาที (Julia Pkg.instantiate)
docker compose up -d
docker compose ps # รอ Up (healthy) ทั้ง 3 บริการ
curl -s http://127.0.0.1:8095/healthz # ok
curl -s http://127.0.0.1:8000/api/v1/health # database.connected = true
docker compose down # หยุด · เพิ่ม -v ถ้าต้องล้างฐานข้อมูล
```
- `WEB_CONTAINER_PORT`/`WEB_HOST_PORT` · `API_CONTAINER_PORT`/`API_HOST_PORT` · `DB_HOST_PORT` = ตัวแปรเดียวที่ต้องแก้
- `deploy/nginx.conf.template` ใช้ `${WEB_CONTAINER_PORT}` (nginx image envsubst ให้เอง) และ proxy `/api/` → `api:${API_CONTAINER_PORT}`
- แก้ไฟล์ static = ต้อง `docker compose up -d --build` (COPY เข้า image ไม่ใช่ mount)
- รายละเอียดทุกตัวแปร: `service/README.md` §6
## อัปเดตเวอร์ชัน — ห้ามแก้มือทีละไฟล์
```bash