feat(docker): add cluster-specific docker-compose configuration for CLIProxyAPI

This commit is contained in:
hkfires
2026-05-19 16:24:34 +08:00
parent bbe30f53b5
commit 7efc1629ba
2 changed files with 34 additions and 0 deletions

5
.env.cluster.example Normal file
View File

@@ -0,0 +1,5 @@
# Cluster JWT example.
# After deploying https://github.com/router-for-me/CLIProxyAPIHome, get the JWT value with:
# curl -sS -X POST "http://<home-host>:8327/v0/management/certificates/clients" -H "X-MANAGEMENT-KEY: <management-key>" | jq -r '.home_jwt'
# Then paste it into HOME_JWT here or export it before starting Compose.
HOME_JWT=your-home-jwt-here

View File

@@ -0,0 +1,29 @@
services:
cli-proxy-api:
image: ${CLI_PROXY_IMAGE:-eceasy/cli-proxy-api:latest}
pull_policy: always
build:
context: .
dockerfile: Dockerfile
args:
VERSION: ${VERSION:-dev}
COMMIT: ${COMMIT:-none}
BUILD_DATE: ${BUILD_DATE:-unknown}
container_name: cli-proxy-api-cluster
environment:
HOME_JWT: ${HOME_JWT:-}
ports:
- "8317:8317"
volumes:
- ./home:/root/.cli-proxy-api
- ./logs:/CLIProxyAPI/logs
command: >
sh -eu -c '
if [ -z "$$HOME_JWT" ]; then
echo "HOME_JWT is required" >&2
exit 1
fi
exec ./CLIProxyAPI -home-jwt "$$HOME_JWT"
'
restart: unless-stopped