-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
87 lines (83 loc) · 2.39 KB
/
docker-compose.yml
File metadata and controls
87 lines (83 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
services:
# 应用服务
app:
build:
context: .
dockerfile: Dockerfile
container_name: localsite-ai-app
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- DB_HOST=db
- DB_PORT=3306
- DB_USER=root
- DB_PASSWORD=localsite_password
- DB_NAME=localsite_ai
- DEFAULT_PROVIDER=kimi
- JWT_SECRET=your_jwt_secret_change_this_in_production
- NEXT_PUBLIC_APP_URL=http://localhost:3000
# AI服务配置 - 需要在.env.local中配置实际的API密钥
- DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY:-}
- DEEPSEEK_API_BASE=https://api.deepseek.com/v1
- MOONSHOT_API_KEY=${MOONSHOT_API_KEY:-}
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
# 阿里云OSS配置
- ALICLOUD_OSS_ENDPOINT=${ALICLOUD_OSS_ENDPOINT:-}
- ALICLOUD_ACCESS_KEY_ID=${ALICLOUD_ACCESS_KEY_ID:-}
- ALICLOUD_ACCESS_KEY_SECRET=${ALICLOUD_ACCESS_KEY_SECRET:-}
- ALICLOUD_OSS_BUCKET=${ALICLOUD_OSS_BUCKET:-}
- ALICLOUD_OSS_REGION=${ALICLOUD_OSS_REGION:-oss-cn-shanghai}
volumes:
- ./public/uploads:/app/public/uploads
- ./workspace:/app/workspace
depends_on:
db:
condition: service_healthy
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- localsite-network
# 数据库服务
db:
image: mysql:8.0
container_name: localsite-ai-db
environment:
- MYSQL_ROOT_PASSWORD=localsite_password
- MYSQL_DATABASE=localsite_ai
- MYSQL_CHARACTER_SET_SERVER=utf8mb4
- MYSQL_COLLATION_SERVER=utf8mb4_unicode_ci
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./localsite_ai.sql:/docker-entrypoint-initdb.d/init.sql:ro
command: --default-authentication-plugin=mysql_native_password
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-plocalsite_password"]
timeout: 20s
retries: 10
interval: 10s
restart: unless-stopped
networks:
- localsite-network
# Redis缓存服务(可选)
redis:
image: redis:7-alpine
container_name: localsite-ai-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
networks:
- localsite-network
volumes:
mysql_data:
driver: local
redis_data:
driver: local
networks:
localsite-network:
driver: bridge