Deploy Claude2Api via Docker Compose
mainUse a docker-compose.yml file to manage the deployment. This is useful for managing multiple environment variables and ensuring the service restarts automatically.
version: '3'
services:
claude2api:
image: ghcr.io/yushangxiao/claude2api:latest
container_name: claude2api
ports:
- "8080:8080"
environment:
- SESSIONS=sk-ant-sid01-xxxx,sk-ant-sid01-yyyy
- ADDRESS=0.0.0.0:8080
- APIKEY=123
- PROXY=http://proxy:2080 # Optional
- CHAT_DELETE=true
- MAX_CHAT_HISTORY_LENGTH=10000
- NO_ROLE_PREFIX=false
- PROMPT_DISABLE_ARTIFACTS=true
- ENABLE_MIRROR_API=false
- MIRROR_API_PREFIX=/mirror
restart: unless-stoppedThen run:
docker-compose up -d