Files
leaudit-platform-frontend/Dockerfile
T
TanWenyan 676e1a5f7d 优化 Docker 配置
主要变更:
- 升级基础镜像从 Node.js 20 到 Node.js 24
- 优化 Dockerfile 权限设置(start.sh 从 777 改为 755)
- 简化 docker-compose.yml 配置,移除 nginx 服务
- 添加 command 指定启动脚本

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 09:50:14 +08:00

36 lines
775 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 使用 Node.js 24 作为基础镜像(Alpine 版)
FROM node:24-alpine
# 设置工作目录
WORKDIR /app
# 安装 PM2 全局
RUN npm install -g pm2
# 安装 pnpm
RUN npm install -g pnpm
# 复制项目文件
COPY . .
# 安装项目依赖(建议使用 pnpm,但你写的是 npm install .
# 如果项目用 pnpm,请改为:RUN pnpm install --frozen-lockfile
RUN npm install .
# 设置 node_modules/.bin 目录的执行权限(通常不需要,但保留)
RUN chmod -R +x node_modules/.bin
# 创建 logs 目录
RUN mkdir -p logs
# 暴露端口
EXPOSE 51703 51704 51705 51706 51707 51708
# 设置环境变量
ENV NODE_ENV=production
# 确保 start.sh 可执行(777 权限过大,建议 755)
RUN chmod +x ./start.sh
# 启动命令
CMD ["./start.sh"]