Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions apps/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ WORKDIR /app
# 根配置
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./

# 只复制 web 包声明(减少依赖安装范围)
# 复制 web 与其 workspace 依赖的包声明,确保 pnpm 能解析本地 workspace 链接
COPY apps/web/package.json ./apps/web/
COPY packages/api-client/package.json ./packages/api-client/
COPY packages/types/package.json ./packages/types/
COPY packages/ui/package.json ./packages/ui/

# Hoisted node_modules so Next standalone output has real files (pnpm symlinks break in runner).
RUN printf '%s\n' 'node-linker=hoisted' > .npmrc
Expand All @@ -35,8 +38,11 @@ COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/apps/web/node_modules ./apps/web/node_modules

# 拷贝源码
# 拷贝 web 与其 workspace 依赖源码,保证 node_modules 中的 workspace 链接有真实目标
COPY apps/web ./apps/web
COPY packages/api-client ./packages/api-client
COPY packages/types ./packages/types
COPY packages/ui ./packages/ui

# 构建参数
ARG NEXT_PUBLIC_API_BASE_URL=/api/v1
Expand Down Expand Up @@ -68,4 +74,4 @@ COPY --from=builder /app/apps/web/public ./apps/web/public
EXPOSE 3000

# Monorepo standalone: server.js lives under apps/web(与 outputFileTracingRoot 一致)
CMD ["node", "apps/web/server.js"]
CMD ["node", "apps/web/server.js"]
Loading