- 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
18 lines
827 B
YAML
18 lines
827 B
YAML
# docker-compose.override.yml — เฉพาะการรันบนเครื่องตัวเอง (local preview)
|
|
# Docker Compose merge ไฟล์นี้อัตโนมัติเมื่อรัน `docker compose up`
|
|
# Dokploy รัน `docker compose -f docker-compose.yml` → ไฟล์นี้ไม่ถูกใช้บนเซิร์ฟเวอร์
|
|
# → host port จึงไม่ชนกับบริการอื่นบนเซิร์ฟเวอร์ และไม่เปิดฐานข้อมูลออกภายนอก
|
|
|
|
services:
|
|
web:
|
|
ports:
|
|
- "${WEB_HOST_PORT:-8097}:${WEB_CONTAINER_PORT:-8080}"
|
|
|
|
api:
|
|
ports:
|
|
- "${API_HOST_PORT:-8000}:${API_CONTAINER_PORT:-8000}"
|
|
|
|
db:
|
|
ports:
|
|
- "${DB_HOST_PORT:-5433}:5432"
|