fix: Docker 构建改用 npm 替代 pnpm + 补全 OAuth/Redis 环境变量

- Dockerfile 全部改为 npm install + 全局 tsc,解决 pnpm 符号链接问题
- docker-compose 添加 Redis 服务、OAuth 环境变量透传、web 端口改为可配置
- MCP URL 改用 window.location.origin 适配反向代理
- tsconfig 添加 paths 映射解决 Docker 内模块引用

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-03 17:24:52 +08:00
parent 8b6aeb28b1
commit 5e6efdaf59
12 changed files with 553 additions and 63 deletions

View File

@@ -3,11 +3,15 @@ services:
ports:
- "5432:5432"
redis:
ports:
- "6379:6379"
server:
build:
context: .
dockerfile: packages/server/Dockerfile
target: deps
target: build
extra_hosts:
- "host.docker.internal:host-gateway"
command: >
@@ -24,6 +28,7 @@ services:
- ./prisma:/app/prisma
environment:
DATABASE_URL: postgresql://agentfox:agentfox@postgres:5432/agentfox
REDIS_URL: redis://redis:6379
JWT_SECRET: dev-secret
JWT_REFRESH_SECRET: dev-refresh-secret
SERVER_PORT: "3000"
@@ -33,7 +38,7 @@ services:
build:
context: .
dockerfile: packages/mcp/Dockerfile
target: deps
target: build
command: >
sh -c "
npx prisma generate --schema=prisma/schema.prisma &&
@@ -48,6 +53,7 @@ services:
- ./prisma:/app/prisma
environment:
DATABASE_URL: postgresql://agentfox:agentfox@postgres:5432/agentfox
REDIS_URL: redis://redis:6379
MCP_PORT: "3001"
NODE_ENV: development