Trae Assistant
initial commit: clean history and remove node_modules
76127be
raw
history blame contribute delete
492 Bytes
# 使用 Node.js 作为构建阶段
FROM node:20-slim AS builder
WORKDIR /app
# 复制 package.json 和 lock 文件
COPY package*.json ./
# 安装依赖
RUN npm install
# 复制项目代码
COPY . .
# 构建项目
RUN npm run build
# 使用 Nginx 作为生产阶段
FROM nginx:alpine
# 复制 Nginx 配置
COPY nginx.conf /etc/nginx/conf.d/default.conf
# 复制构建产物到 Nginx
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 7860
CMD ["nginx", "-g", "daemon off;"]