适配最新的食谱

This commit is contained in:
2026-05-10 22:14:51 +08:00
parent e4bfb98482
commit 3ae44d1015
3 changed files with 33 additions and 22 deletions
+8 -6
View File
@@ -7,17 +7,21 @@ WORKDIR /app
# 国内镜像加速
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# 安装 pnpm(不使用 corepack
RUN npm install -g pnpm
COPY package.json pnpm-lock.yaml ./
# 国内源 + 快速启用 pnpm
RUN corepack enable && \
npm config set registry https://registry.npmmirror.com && \
# 设置国内镜像源
RUN npm config set registry https://registry.npmmirror.com && \
pnpm config set registry https://registry.npmmirror.com
# 安装依赖
RUN pnpm install --frozen-lockfile
COPY . .
# 构建项目
RUN pnpm build
# Stage 2: Runner
@@ -39,13 +43,11 @@ COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
# ===================== 修复权限错误 =====================
# 复制项目根目录的配置文件
# 复制配置文件
COPY --from=builder /app/config.json ./
# 给 nextjs 用户授权整个目录
RUN chown -R nextjs:nodejs /app
# ========================================================
USER nextjs