This commit is contained in:
parent
3a369ed46e
commit
8e83ecc94e
|
|
@ -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"]
|
||||
|
|
|
|||
Loading…
Reference in New Issue