fix(deploy): Dokploy-safe compose split + resilient db healthcheck

- docker-compose.yml is now the server form: no published host ports
  (expose only), so a port already taken on the host can no longer stop
  the stack; local ports moved to docker-compose.override.yml, which
  Dokploy never reads
- db healthcheck probes TCP 127.0.0.1 instead of the unix socket and
  allows start_period 30s / 12 retries while initdb finishes
- api start_period 20s
This commit is contained in:
Bkk1234 committed 2026-11-23 11:35:09 +07:00
1 parent 1b6c56b47c
commit b676889816
4 files changed
+46 -15

No files matched your search

+2
View File
@@ -60,6 +60,8 @@ docker compose down # หยุด · เพิ่ม -v ถ้
```
- `WEB_CONTAINER_PORT`/`WEB_HOST_PORT` · `API_CONTAINER_PORT`/`API_HOST_PORT` · `DB_HOST_PORT` = ตัวแปรเดียวที่ต้องแก้
- `docker-compose.yml` = รูปแบบ deploy (ไม่มี host port, ใช้ `expose`) · `docker-compose.override.yml` = host port สำหรับรันบนเครื่อง (compose merge ให้เอง)
- Dokploy รัน `docker compose -f docker-compose.yml` → override ไม่ถูกใช้ และพอร์ตในคอนเทนเนอร์ยังมาจาก env ชุดเดียวกัน
- `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