From 2e951f99f400958b0644e67d02290422e5a3ee27 Mon Sep 17 00:00:00 2001
From: oom
Date: Wed, 4 Nov 2026 00:33:07 +0700
Subject: [PATCH] fix worker not found module in build standalone fix next/link
prefetch/call twice(replace with a)
---
app/tmpl/page.tsx | 26 ++++++++++++------------
docker-compose.yml | 28 ++++++++++++++++++++++++++
next.config.mjs | 16 ++++++++++++++-
public/wordaddin/manifest.template.xml | 17 +---------------
4 files changed, 57 insertions(+), 30 deletions(-)
diff --git a/app/tmpl/page.tsx b/app/tmpl/page.tsx
index 64b7b60..2798a00 100644
--- a/app/tmpl/page.tsx
+++ b/app/tmpl/page.tsx
@@ -118,12 +118,13 @@ export default function HomePage() {
@@ -136,7 +137,6 @@ export default function HomePage() {
Template & Data
-
Template:
T_X.docx,
T12_X.docx
Data:
TF_no_warning_P2.json,
@@ -155,7 +155,7 @@ export default function HomePage() {
@@ -196,7 +196,7 @@ export default function HomePage() {
Flow
-
+
ลิงค์เลือกไฟล์
↓
@@ -210,7 +210,7 @@ export default function HomePage() {
↓
อัปเดตฐานข้อมูลและไฟล์
-
+
@@ -254,9 +254,9 @@ export default function HomePage() {
install-word-addins.ps1
แล้วใช้คำสั่ง PowerShell ด้านล่างเพื่อติดตั้ง Add-ins ใน Word
- Unblock-File .\install-word-addins.ps1
- Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned -Force
- .\install-word-addins.ps1 -Install
+ Unblock-File .\install-word-addins.ps1
+ Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned -Force
+ .\install-word-addins.ps1 -Install
diff --git a/docker-compose.yml b/docker-compose.yml
index f54a618..c2f1cd5 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -6,6 +6,34 @@
# judes-note-db เก่ารันอยู่ (สร้างด้วย docker run) ให้ `docker rm -f judes-note-db`
# ก่อน แล้ว compose จะต่อวอลุ่ม judes-note-db-data เดิมได้เลย ข้อมูลไม่หาย
services:
+ docedit:
+ build:
+ context: .
+ dockerfile: docker/web.Dockerfile
+ restart: unless-stopped
+ environment:
+ - SECRET=${SECRET}
+ - PRIVATE_KEY_HEX=${PRIVATE_KEY_HEX}
+ - PUBLIC_KEY_HEX=${PUBLIC_KEY_HEX}
+ - EXTERNAL_API_KEY=${EXTERNAL_API_KEY}
+ - DOCVER_API_KEY=${DOCVER_API_KEY}
+ - DOCVER_TOKEN_SECRET=${DOCVER_TOKEN_SECRET}
+ - DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@db:5432/note
+ ### สำหรับโค้ดตัวอย่างระบบนอกเรียกเข้ามาไม่ได้ใช้ในระบบนี้ ห้ามเอาไช้
+ - DOCEDIT_BASE_URL=http://docedit:3000/docedit
+ - TICKET_SEC=300
+ - DOCX_WORKERS=4
+
+
+ ports:
+ - "3000:3000"
+ depends_on:
+ db:
+ condition: service_healthy
+ minio:
+ condition: service_healthy
+
+
db:
image: postgres:18-alpine
restart: unless-stopped
diff --git a/next.config.mjs b/next.config.mjs
index 8d37633..3d6b9f9 100644
--- a/next.config.mjs
+++ b/next.config.mjs
@@ -34,7 +34,21 @@ const nextConfig = {
];
},
experimental: {
- serverComponentsExternalPackages: ['piscina']
+ serverComponentsExternalPackages: ['piscina'],
+ outputFileTracingIncludes: {
+ // ปรับ Path ฝั่งซ้ายให้ตรงกับ API Route หรือจุดที่เรียกใช้ Piscina
+ '/api/**/*': [
+ 'node_modules/piscina/**/*',
+ 'node_modules/pizzip/**/*',
+ 'node_modules/@xmldom/xmldom/**/*',
+ 'node_modules/xpath/**/*',
+ 'node_modules/docx-templates/**/*',
+ 'node_modules/jszip/**/*',
+ 'node_modules/setimmediate/**/*',
+ 'node_modules/pako/**/*',
+ 'workers/**/*' // Path ที่เก็บไฟล์ worker.js ของคุณ (ปรับตามจริง)
+ ],
+ },
}
};
diff --git a/public/wordaddin/manifest.template.xml b/public/wordaddin/manifest.template.xml
index a51ebb1..c637200 100644
--- a/public/wordaddin/manifest.template.xml
+++ b/public/wordaddin/manifest.template.xml
@@ -1,22 +1,7 @@
4a1e184a-ab31-4fa4-b3c7-9a2283051c3f