forked from lorryjovens-hub/claude-code-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
67 lines (57 loc) · 1.53 KB
/
docker-compose.yml
File metadata and controls
67 lines (57 loc) · 1.53 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
version: '3.8'
services:
claude-code:
build:
context: .
dockerfile: Dockerfile
image: claude-code-rust:latest
container_name: claude-code
# 交互式终端
stdin_open: true
tty: true
# 卷挂载
volumes:
# 配置文件持久化
- claude-config:/home/claude/.config/claude-code
# 可选:挂载项目目录
# - .:/workspace
# 环境变量
environment:
# 使用你的 API 密钥配置下列变量
# ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
# API_BASE_URL: ${API_BASE_URL}
# 或使用阿里云 DashScope
# DASHSCOPE_API_KEY: ${DASHSCOPE_API_KEY}
# API_BASE_URL: https://coding.dashscope.aliyuncs.com/v1
# 网络(可选)
networks:
- claude-network
# 重启策略
restart: no
volumes:
claude-config:
driver: local
networks:
claude-network:
driver: bridge
# ==========================================
# 使用说明:
# ==========================================
#
# 1. 启动 REPL 交互模式:
# docker-compose run --rm claude-code repl
#
# 2. 执行单次查询:
# docker-compose run --rm claude-code query --prompt "你的问题"
#
# 3. 查看版本:
# docker-compose run --rm claude-code --version
#
# 4. 查看帮助:
# docker-compose run --rm claude-code --help
#
# 5. 使用环境变量配置 API(create .env file):
# ANTHROPIC_API_KEY=sk-ant-xxxxxxx
# API_BASE_URL=https://api.anthropic.com
# docker-compose run --rm claude-code repl
#