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
|
|
@ -33,10 +33,14 @@ ENV NODE_ENV=production \
|
|||
PORT=3000 \
|
||||
HOSTNAME=0.0.0.0
|
||||
RUN addgroup -S nodejs && adduser -S nextjs -G nodejs
|
||||
# Next 14.2 รวม public/ (pdf.worker, ฟอนต์ Sarabun, samples PDF) ไว้ใน standalone แล้ว
|
||||
# แต่ไม่รวม .next/static (JS chunks) — ต้องคัดลอกเพิ่ม ไม่งั้นหน้าเว็บไม่มี JS
|
||||
# Next 14.2 standalone **ไม่รวม public/ และ .next/static เอง** — ต้องคัดลอกเองทั้งคู่
|
||||
# (ก่อนหน้านี้เข้าใจผิดว่า Next รวม public/ ให้: จริง ๆ มันหลุดเข้ามาแค่บางส่วนผ่าน output
|
||||
# file tracing ที่ตาม fs.readFile ของ server code (public/note จาก lib/server-pdf.ts,
|
||||
# ฟอนต์ Sarabun จาก export route) — public/wordaddin/office-js ไม่มีใครอ่านผ่าน fs
|
||||
# จึงไม่ถูกดึงมา แล้ว taskpane พังใน production 2026-10-16)
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
||||
# migration: ไฟล์ SQL (drizzle-kit generate) + runner — รันตอน container start
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/drizzle ./drizzle
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/scripts ./scripts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue