feat(docker): 添加完整的 Docker 构建支持

- 重构 Dockerfile 支持本地完整源码构建流程
- 添加 CI 专用的 Dockerfile.ci 使用预构建产物
- 创建 .dockerignore 和 .dockerignore.ci 文件优化构建上下文
- 添加 build-docker.sh 和 build-docker.bat 本地构建脚本
- 更新 GitHub Actions 工作流支持 Node.js 环境和 pnpm 依赖管理
- 添加 DOCKER.md 详细说明文档
- 优化 nginx 配置和端口暴露设置
This commit is contained in:
coolxitech
2026-01-08 17:13:46 +08:00
parent 21cf5762d2
commit d9c708e0ca
8 changed files with 279 additions and 13 deletions

18
build-docker.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
# 本地 Docker 构建脚本
# 使用完整的源代码构建流程
echo "🚀 开始本地 Docker 构建..."
# 构建镜像
docker build -t ogame-vue-ts:local .
if [ $? -eq 0 ]; then
echo "✅ Docker 镜像构建成功!"
echo "📦 镜像标签: ogame-vue-ts:local"
echo "🏃 运行命令: docker run -p 8080:80 ogame-vue-ts:local"
else
echo "❌ Docker 镜像构建失败!"
exit 1
fi