This commit is contained in:
parent
4c765bca87
commit
a9555be314
|
|
@ -22,6 +22,10 @@
|
|||
# 编译 Next.js 应用
|
||||
RUN pnpm turbo run build --filter=apps/blogai
|
||||
|
||||
# 切换到子项目目录,单独安装生产依赖
|
||||
WORKDIR /app/apps/blogai
|
||||
RUN pnpm install --prod
|
||||
|
||||
# --- 第二阶段:生产环境运行阶段 ---
|
||||
FROM node:18-slim AS runner
|
||||
|
||||
|
|
@ -35,10 +39,10 @@
|
|||
# 设置运行目录
|
||||
WORKDIR /app
|
||||
|
||||
# 复制生产所需文件
|
||||
# 复制生产所需文件(注意:以子项目为主)
|
||||
COPY --from=builder /app/apps/blogai/package.json ./package.json
|
||||
COPY --from=builder /app/pnpm-lock.yaml ./pnpm-lock.yaml
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/apps/blogai/pnpm-lock.yaml ./pnpm-lock.yaml
|
||||
COPY --from=builder /app/apps/blogai/node_modules ./node_modules
|
||||
COPY --from=builder /app/apps/blogai/.next ./.next
|
||||
COPY --from=builder /app/apps/blogai/public ./public
|
||||
COPY --from=builder /app/apps/blogai/next.config.js ./next.config.js
|
||||
|
|
|
|||
Loading…
Reference in New Issue