使用Docker快速部署CC-Gateway
CC-Gateway支持两种Docker部署方式:docker-compose(推荐)和docker run命令。
mkdir cc-gateway && cd cc-gateway
创建config.yaml文件,参考 配置详解:
gateway:
port: 8080
identity:
device_id: "your-standardized-device-id"
email: "user@example.com"
env:
platform: darwin
arch: arm64
os_version: "Darwin 24.4.0"
node_version: v24.3.0
terminal: iTerm2.app
shell: zsh
upstream:
base_url: https://api.anthropic.com
api_key: "your-api-key"
services:
cc-gateway:
image: cc-gateway:latest
container_name: cc-gateway
ports:
- "8080:8080"
volumes:
- ./config.yaml:/app/config.yaml:ro
restart: unless-stopped
environment:
- TZ=Asia/Shanghai
docker-compose up -d
docker run -d \
--name cc-gateway \
-p 8080:8080 \
-v $(pwd)/config.yaml:/app/config.yaml:ro \
-e TZ=Asia/Shanghai \
--restart unless-stopped \
cc-gateway:latest
docker logs -f cc-gateway
docker restart cc-gateway
docker stop cc-gateway
docker pull cc-gateway:latest
docker-compose up -d
如果你需要持久化配置文件,可以创建一个数据卷:
docker volume create cc-gateway-config
如果你的环境需要通过代理访问外网,可以在docker-compose.yaml中配置:
services:
cc-gateway:
environment:
- HTTP_PROXY=http://your-proxy:port
- HTTPS_PROXY=http://your-proxy:port