Skip to content

Commit 4873528

Browse files
committed
添加完整的Docker部署配置
包含: 1. Dockerfile - 多阶段构建,优化镜像大小 2. docker-compose.yml - 完整服务栈配置 3. docker-entrypoint.sh - 启动脚本 4. docker-deploy.sh - 自动化部署脚本 5. .env.docker - Docker环境变量模板 6. DOCKER_DEPLOYMENT.md - 完整部署文档 7. .dockerignore - Docker忽略文件 特性: - 支持多阶段构建,镜像体积小 - 包含健康检查和监控 - 支持完整服务栈(数据库、Redis、Nginx、监控) - 自动化部署脚本 - 生产环境就绪配置 - 详细部署文档
1 parent 07afc43 commit 4873528

File tree

7 files changed

+826
-18
lines changed

7 files changed

+826
-18
lines changed

.dockerignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# 忽略文件
2+
.git
3+
.gitignore
4+
.DS_Store
5+
.idea
6+
.vscode
7+
*.iml
8+
9+
# 忽略日志和临时文件
10+
logs/
11+
target/
12+
*.log
13+
*.tmp
14+
*.temp
15+
16+
# 忽略测试文件
17+
**/test/
18+
**/*Test.java
19+
**/*Tests.java
20+
21+
# 忽略文档和配置文件(根据需要调整)
22+
*.md
23+
!README.md
24+
!DOCKER_DEPLOYMENT.md
25+
.env
26+
!*.example
27+
28+
# 忽略Maven包装器(如果需要可以包含)
29+
.mvn/wrapper/maven-wrapper.jar
30+
31+
# 忽略Node.js文件(如果项目有前端)
32+
node_modules/
33+
npm-debug.log
34+
yarn-error.log
35+
36+
# 忽略IDE配置文件
37+
.project
38+
.classpath
39+
.settings/

.env.docker

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Docker部署环境变量配置
2+
# 复制此文件为.env并在部署前修改
3+
4+
# ========== 应用配置 ==========
5+
# 主机端口映射
6+
HOST_PORT=8080
7+
8+
# AI服务配置
9+
AI_API_KEY=your_deepseek_api_key_here
10+
AI_MODEL=deepseek-chat
11+
AI_BASE_URL=https://api.deepseek.com
12+
AI_TIMEOUT=30000
13+
AI_MAX_TOKENS=1000
14+
AI_ENABLED=true
15+
16+
# ========== 数据库配置(可选) ==========
17+
DB_PASSWORD=ai_password
18+
DB_PORT=5432
19+
20+
# ========== Redis配置(可选) ==========
21+
REDIS_PORT=6379
22+
23+
# ========== 监控配置(可选) ==========
24+
GRAFANA_PASSWORD=admin
25+
26+
# ========== 高级配置 ==========
27+
# JVM参数
28+
JAVA_OPTS=-Xmx512m -Xms256m -XX:+UseG1GC
29+
30+
# 时区
31+
TZ=Asia/Shanghai
32+
33+
# 日志级别
34+
LOGGING_LEVEL_ROOT=INFO

0 commit comments

Comments
 (0)