From 8e83ecc94e6c4422d98d9d4a985ff042a68f4417 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 28 Jul 2025 17:18:03 +0800 Subject: [PATCH] . --- php_pc/Dockerfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/php_pc/Dockerfile b/php_pc/Dockerfile index 7b9f53f..7f6aede 100644 --- a/php_pc/Dockerfile +++ b/php_pc/Dockerfile @@ -22,12 +22,16 @@ WORKDIR /app # 拷贝构建产物 COPY --from=builder /app/.output .output -# 安装生产依赖(如有) -COPY package*.json yarn.lock ./ -RUN yarn install --production --frozen-lockfile +# 只拷贝必要的运行文件(不执行 yarn install) +# 如果 Nuxt 构建产物已完整,可不再安装依赖 +# COPY package*.json yarn.lock ./ +# RUN yarn install --production --frozen-lockfile + +# ✅ 安装 serve 用于启动 SSR 服务 +RUN npm install -g serve # 暴露端口 EXPOSE 8091 -# 启动 Nuxt +# 启动 Nuxt SSR 服务 CMD ["node", ".output/server/index.mjs"]