Repository navigation
Expand file tree
/
Copy pathdocker-compose.gpu.yml
More file actions
56 lines (52 loc) · 1.59 KB
/
Copy pathdocker-compose.gpu.yml
File metadata and controls
56 lines (52 loc) · 1.59 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
services:
backend:
container_name: fastread-backend
build:
context: .
dockerfile: backend/Dockerfile.gpu
args:
APT_MIRROR: ${APT_MIRROR:-mirrors.tuna.tsinghua.edu.cn}
PIP_INDEX: ${PIP_INDEX:-https://pypi.tuna.tsinghua.edu.cn/simple}
environment:
BACKEND_PORT: ${BACKEND_PORT:-8483}
BACKEND_HOST: 0.0.0.0
ALLOW_NON_LOCAL_ADMIN: "true"
FASTREAD_DATA_ROOT: /app/runtime
DATABASE_URL: sqlite:////app/runtime/fastread.db
BRAVE_SEARCH_API_KEY: ${BRAVE_SEARCH_API_KEY:-}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
OPENAI_BASE_URL: ${OPENAI_BASE_URL:-}
DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY:-}
DEEPSEEK_BASE_URL: ${DEEPSEEK_BASE_URL:-}
volumes:
- fastread-data:/app/runtime
expose:
- "${BACKEND_PORT:-8483}" # 不再对外暴露,用于 nginx 内部通信
deploy:
resources:
reservations:
devices:
- driver: "nvidia"
count: "all"
capabilities: ["gpu"]
frontend:
container_name: fastread-frontend
build:
context: .
dockerfile: fastread-frontend/Dockerfile
expose:
- "80" # 不暴露给宿主机,只供 nginx 访问
nginx:
container_name: fastread-nginx
image: ${NGINX_RUNTIME_IMAGE:-mirror.gcr.io/library/nginx:1.25-alpine}
ports:
- "127.0.0.1:${APP_PORT:-3015}:80"
environment:
- BACKEND_PORT=${BACKEND_PORT:-8483}
volumes:
- ./nginx/default.conf:/etc/nginx/templates/default.conf.template
depends_on:
- backend
- frontend
volumes:
fastread-data: