1 Star 1 Fork 0

chuangyeshuo/R2R-Application

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 974 Bytes
一键复制 编辑 原始数据 按行查看 历史
NolanTrem 提交于 2024-10-25 15:10 . Allow runtime env vars
# 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"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chuangyeshuo/R2R-Application.git
git@gitee.com:chuangyeshuo/R2R-Application.git
chuangyeshuo
R2R-Application
R2R-Application
main

搜索帮助