feat: 添加 Dockerfile 和 CI/CD 部署配置
aboutme / deploy (push) Failing after 13s

This commit is contained in:
2026-08-20 10:22:16 +08:00
parent 214acfd33c
commit 616a1343e8
5 changed files with 177 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
FROM aboutme-base:latest AS builder
WORKDIR /app
ENV NEXT_TELEMETRY_DISABLED=1
# 复制包管理文件,利用 Docker 层缓存
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
RUN pnpm install --frozen-lockfile
# 复制源码并构建(standalone 产物给运行阶段)
COPY . .
RUN pnpm build
FROM node:22-alpine
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV PORT=3000
ENV HOSTNAME=0.0.0.0
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
EXPOSE 3000
CMD ["node", "server.js"]