forked from datawhale/whale-town-end
feat: 添加生产环境部署配置
- 添加 Dockerfile 和 docker-compose.yml 支持容器化部署 - 添加 PM2 配置文件 ecosystem.config.js - 添加部署脚本模板 deploy.sh.example - 添加 Gitea webhook 处理器模板 webhook-handler.js.example - 添加生产环境配置模板 .env.production.example - 添加详细的部署指南 DEPLOYMENT.md - 更新 .gitignore 排除敏感配置文件
This commit is contained in:
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
# 使用官方 Node.js 镜像
|
||||
FROM node:18-alpine
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 安装 pnpm
|
||||
RUN npm install -g pnpm
|
||||
|
||||
# 复制 package.json 和 pnpm-lock.yaml
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
|
||||
# 安装依赖
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
# 复制源代码
|
||||
COPY . .
|
||||
|
||||
# 构建应用
|
||||
RUN pnpm run build
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 3000
|
||||
|
||||
# 启动应用
|
||||
CMD ["pnpm", "run", "start:prod"]
|
||||
Reference in New Issue
Block a user