diff --git a/Dockerfile b/Dockerfile index b5ac1b1..76f419e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,8 @@ COPY --from=builder /app/.next/standalone ./ COPY --from=builder /app/.next/static ./.next/static # 复制 prisma schema (用于数据库迁移) COPY --from=builder /app/prisma ./prisma +# 复制 public 静态文件 +COPY --from=builder /app/public ./public RUN mkdir -p /app/data && chown nextjs:nodejs /app/data USER nextjs diff --git a/docker-compose.yml b/docker-compose.yml index 8099a25..3fb43f7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,11 +6,12 @@ services: - "3000:3000" extra_hosts: - "host.docker.internal:host-gateway" + - "df.clkeji.com:host-gateway" environment: - DATABASE_URL=file:/app/data/dev.db - NEXTAUTH_SECRET=nextapp-secret-key-2026 - NEXTAUTH_URL=http://localhost:3000 - - DIFY_API_URL=http://host.docker.internal/v1/chat-messages + - DIFY_API_URL=http://df.clkeji.com/v1/chat-messages - DIFY_API_KEY=app-lbe2lglt7taGtZk0dG7pAhbx volumes: - ./prisma/dev.db:/app/data/dev.db diff --git a/prisma/dev.db b/prisma/dev.db index 79f2847..5376838 100644 Binary files a/prisma/dev.db and b/prisma/dev.db differ diff --git a/prisma/seed.ts b/prisma/seed.ts index f1b8a86..7df2052 100644 --- a/prisma/seed.ts +++ b/prisma/seed.ts @@ -115,8 +115,8 @@ async function main() { status: "active", isFeatured: true, featuredOrder: 1, - difyApiUrl: "https://api.dify.ai/v1", - difyApiKey: "app-demo-key-123456", + difyApiUrl: "http://host.docker.internal/v1", + difyApiKey: "app-lbe2lglt7taGtZk0dG7pAhbx", }, }), prisma.agent.upsert({ @@ -218,6 +218,33 @@ async function main() { status: "active", }, }), + prisma.agent.upsert({ + where: { slug: "talent-service" }, + update: {}, + create: { + name: "人才服务智能体", + slug: "talent-service", + description: "提供人才政策查询、招聘信息匹配、职业规划咨询、人才补贴申请等一站式人才服务。", + icon: "👥", + categoryId: categories[6].id, + features: "人才政策查询, 招聘信息匹配, 职业规划, 人才补贴申请", + hotQuestions: JSON.stringify([ + "淮安市有哪些人才引进政策?", + "如何申请人才补贴?", + "高层次人才认定标准是什么?", + "人才公寓如何申请?", + ]), + quickQuestions: JSON.stringify([ + "人才政策查询", + "人才补贴申请", + "招聘信息", + ]), + usageCount: 200, + status: "active", + isFeatured: true, + featuredOrder: 4, + }, + }), ]) console.log("Created agents:", agents.map(a => a.name).join(", ")) diff --git a/测试/error2.txt b/测试/error2.txt deleted file mode 100644 index 2852410..0000000 --- a/测试/error2.txt +++ /dev/null @@ -1,5 +0,0 @@ -Chat API error: TypeError: fetch failed - at async c (.next/server/app/api/chat/route.js:1:1010) { - [cause]: [Error [ConnectTimeoutError]: Connect Timeout Error (attempted address: df.clkeji.com:80, timeout: 10000ms)] { - code: 'UND_ERR_CONNECT_TIMEOUT' - } 该服务宿主机可通过localhost访问,怎么修改地址,能访问到该服务 \ No newline at end of file