fix(docker): copy public/ into production image
All checks were successful
Deploy eCourt Note Web to Server / Validate Database Schema (Drizzle) (push) Successful in 4s
Deploy eCourt Note Web to Server / Build Web Docker Image (push) Successful in 1m0s
Deploy eCourt Note Web to Server / Deploy eCourt Note Web to Server (push) Successful in 4s
Deploy eCourt Note Web to Server / Notify Deployment Status (push) Successful in 0s
All checks were successful
Deploy eCourt Note Web to Server / Validate Database Schema (Drizzle) (push) Successful in 4s
Deploy eCourt Note Web to Server / Build Web Docker Image (push) Successful in 1m0s
Deploy eCourt Note Web to Server / Deploy eCourt Note Web to Server (push) Successful in 4s
Deploy eCourt Note Web to Server / Notify Deployment Status (push) Successful in 0s
taskpane wordaddin พังใน production — "โหลด Office.js ไม่สำเร็จ" เพราะ browser ยิง /docedit/wordaddin/office-js/office.js ได้ 404: image ไม่มี public/wordaddin อยู่เลย สาเหตุ: Next 14.2 standalone ไม่ copy public/ เอง (comment เดิมใน Dockerfile เข้าใจผิด) — ไฟล์ static ที่เคยใช้ได้หลุดเข้า image แบบ บังเอิญผ่าน output file tracing ที่ตาม fs.readFile ใน server code (public/note จาก lib/server-pdf.ts, ฟอนต์ Sarabun จาก export route) แต่ public/wordaddin/** ไม่มี server code ไหนอ่านผ่าน fs จึงไม่ถูก ดึงมา แก้: เพิ่ม COPY --from=builder /app/public ./public ใน runner stage ตามเอกสาร deploy ของ Next + แก้ comment Dockerfile และ docs/WORDADDIN-DEV.md ให้เล่ากลไกจริง ยืนยันด้วยการ build image ใหม่แล้วรัน container จริง: office.js / manifest.xml / word-win32-16.01.js / th-th strings / pdf.worker ทุก URL ตอบ 200 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
parent
2b70a50c62
commit
808233191d
2 changed files with 7 additions and 3 deletions
|
|
@ -60,6 +60,6 @@ Deploy จริง (intranet): rewrite URL ทุกตัวใน manifest
|
|||
|
||||
## Docker
|
||||
|
||||
ไม่ต้องทำอะไรเพิ่ม — `docker/web.Dockerfile` รัน `scripts/fetch-office-js.mjs` ใน build อยู่แล้ว (build stage ต้องออกอินเทอร์เน็ตถึง `appsforoffice.microsoft.com` ได้) และ Next รวม `public/` ไว้ใน standalone อัตโนมัติ
|
||||
ไม่ต้องทำอะไรเพิ่ม — `docker/web.Dockerfile` รัน `scripts/fetch-office-js.mjs` ใน build อยู่แล้ว (build stage ต้องออกอินเทอร์เน็ตถึง `appsforoffice.microsoft.com` ได้) และ runner stage คัดลอก `public/` เข้า image เอง (`COPY /app/public ./public` — **Next 14.2 standalone ไม่รวม `public/` ให้อัตโนมัติ** ต้อง copy เองตามเอกสาร deploy ของ Next; เคยเข้าใจผิดว่า Next รวมให้ เพราะบางไฟล์หลุดเข้า image ผ่าน output file tracing ของ Next ที่ตาม `fs.readFile` ใน server code — แต่ `public/wordaddin/office-js` ไม่มีใครอ่านผ่าน fs จึงไม่ถูกดึงมา แล้ว taskpane พังใน production 2026-10-16)
|
||||
|
||||
> ทำไมต้องเป็นฉบับ CDN ล่าสุด: แพ็กเกจ npm `@microsoft/office-js` เลิกอัปเดตที่ 1.1.110 (~2018) ก่อน WordApi 1.4/1.5 — runtime ตัวนั้นไม่มี `Document.close` (ปุ่ม "บันทึกเวอร์ชันและปิดเอกสาร" พัง: `context.document.close is not a function`) และไม่มี enum `Word.CloseBehavior`/`SaveBehavior` ทับ ๆ กับ `@types/office-js` ฉบับใหม่ที่ใช้ compile
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue