配置好服务器网络配置

增加 docker 部署配置
This commit is contained in:
2025-08-01 16:05:41 +08:00
parent 6727d62272
commit ec2901da03
8 changed files with 248 additions and 149 deletions
+31
View File
@@ -0,0 +1,31 @@
# 使用Node.js 20作为基础镜像
FROM node:20-alpine
# 设置工作目录
WORKDIR /app
# 安装PM2全局
RUN npm install -g pm2
# 安装pnpm
RUN npm install -g pnpm
# 复制项目文件
COPY . .
# 安装项目依赖
RUN npm install .
# 创建logs目录
RUN mkdir -p logs
# 暴露端口(根据pm2配置,需要暴露51703-51708端口)
EXPOSE 51703 51704 51705 51706 51707 51708
# 设置环境变量
ENV NODE_ENV=production
RUN chmod 777 ./start.sh
# CMD ["npm", "run", "start:pm2:multi"]
# 启动命令 - 使用tail阻塞容器
CMD ["./start.sh"]