代码拉取完成,页面将自动刷新
# Builder Stage
FROM node:22-alpine AS builder
WORKDIR /app
# Install pnpm
RUN npm install -g pnpm
# Copy package.json and pnpm-lock.yaml
COPY package.json pnpm-lock.yaml* ./
# Install dependencies
RUN pnpm install --frozen-lockfile
# Copy the rest of the application code
COPY . .
# Build the Next.js application
RUN pnpm build
# Production Stage
FROM node:22-alpine AS runner
WORKDIR /app
# Install pnpm
RUN npm install -g pnpm
# Set node environment to production
ENV NODE_ENV=production
# Copy necessary files from builder stage
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
# Copy the startup script
COPY startup.sh /app/startup.sh
# Ensure the startup script is executable
RUN chmod +x /app/startup.sh
# Expose the port the app runs on
EXPOSE 3000
# Define the command to run the startup script
CMD ["/app/startup.sh"]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。