Commit Graph
3 Commits
Author SHA1 Message Date
Bkk1234 ae34597847 feat(docker): nginx static-export image + Dokploy compose with env-driven PORT/origin
- Dockerfile: nginx:1.27-alpine serving the exported site, PORT from env,
  /healthz healthcheck, origin rewrite hook in docker-entrypoint.d
- docker/default.conf.template: envsubst PORT, clean URLs without trailing-slash
  redirect, long cache for hashed assets, no-cache for HTML/sw.js/manifest,
  301 http->https via X-Forwarded-Proto, gzip
- docker/security-headers.conf: single include so add_header survives per location
- docker-compose.yml (Dokploy, no host ports) + docker-compose.override.yml (local)
- bake canonical/OG/sitemap/robots origin to https://alterflixhub.hobbypj.com
  (was the export-time 127.0.0.1:8090), overridable via PUBLIC_ORIGIN
- docs/deploy-dokploy.md
2026-11-22 22:48:12 +07:00
Bkk1234 e6c4ebff48 chore(publish): replace source tree with static export at repo root
Publish the prerendered static export (index.html, 404.html, cinema/,
c/, about/, for-cinemas/, for-film-lovers/, assets/, images/, og/,
sitemap.xml, robots.txt) as the site root and remove the React Router
+ Nitro source tree from this branch. Source remains available in
history at 0548772.

Note: public/sw.js here reports VERSION v2.0.5 while the removed source
tree (v2.1.0) was newer, and .gitignore was not carried over.
2026-11-22 22:24:36 +07:00
Bkk1234 05487728a7 fix(docker): แยก compose เป็น base (Dokploy) + override (ในเครื่อง) — แก้ port already allocated
Dokploy รัน `docker compose -f ./docker-compose.yml up -d --build` บน server
แล้วล้มที่ "Bind for 0.0.0.0:8095 failed: port is already allocated"

- docker-compose.yml: ถอด `ports:` ออก ใช้ `expose: ${PORT}` แทน (reverse proxy ต่อผ่าน compose network)
  · ถอด `container_name` (ชนกันเมื่อมีหลาย deployment บนเครื่องเดียว)
  · เปลี่ยน bind mount ./data → named volume `data` (Docker คัดลอก ownership uid 1000 จาก image
    ทำให้ user `node` เขียน content/uploads/pglite ได้; bind mount บน Linux เป็น root:root = เขียนไม่ได้)
- docker-compose.override.yml (ใหม่): `ports: ${HOST_PORT}:${PORT}` + bind ./data — เฉพาะรันในเครื่อง
  (Dokploy ระบุ `-f ./docker-compose.yml` ตรง ๆ จึงไม่โหลด override)
- README: อธิบาย compose 2 ชั้น, เหตุผลที่ห้าม publish พอร์ต/ใส่ container_name, และเตือนว่า data/ ไม่อยู่ใน git
2026-11-21 22:10:40 +07:00