-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
66 lines (62 loc) · 1.69 KB
/
docker-compose.yml
File metadata and controls
66 lines (62 loc) · 1.69 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
version: '3.8'
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: lc-studylab-backend
ports:
- "8000:8000"
environment:
# OpenAI 配置
- OPENAI_API_KEY=${OPENAI_API_KEY}
- OPENAI_API_BASE=${OPENAI_API_BASE:-https://api.openai.com/v1}
- OPENAI_MODEL=${OPENAI_MODEL:-gpt-4o}
# Tavily 搜索 API(可选)
- TAVILY_API_KEY=${TAVILY_API_KEY:-}
# 高德天气 API(可选)
- AMAP_KEY=${AMAP_KEY:-}
# 服务器配置
- SERVER_HOST=0.0.0.0
- SERVER_PORT=8000
- SERVER_RELOAD=false
# 日志配置
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- LOG_FILE=logs/app.log
# 应用配置
- APP_NAME=LC-StudyLab
- APP_VERSION=0.1.0
- DEBUG=${DEBUG:-false}
volumes:
# 持久化数据目录
- ./backend/data:/app/data
- ./backend/logs:/app/logs
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- lc-studylab-network
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: lc-studylab-frontend
ports:
- "3000:3000"
environment:
- NODE_ENV=production
# Docker 内部使用服务名,外部访问使用 localhost
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://backend:8000}
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
networks:
- lc-studylab-network
networks:
lc-studylab-network:
driver: bridge