Read this in other languages: English, 简体中文.
Docker 部署指南
快速入门
1. 构建镜像
bash
docker build -t hotplex:latest .2. 运行容器
bash
docker run -d \
--name hotplex \
-p 8080:8080 \
-v /var/run/docker.sock:/var/run/docker.sock \
-e CLAUDE_API_KEY=your-key \
hotplex:latestDocker Compose 配置
yaml
version: '3.8'
services:
hotplex:
image: hotplex:latest
ports:
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- hotplex-data:/data
environment:
- PORT=8080
- LOG_LEVEL=info
- IDLE_TIMEOUT=30m
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
volumes:
hotplex-data:Kubernetes 部署
yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: hotplex
spec:
replicas: 3
selector:
matchLabels:
app: hotplex
template:
metadata:
labels:
app: hotplex
spec:
containers:
- name: hotplex
image: hotplex:latest
ports:
- containerPort: 8080
livenessProbe:
httpGet:
path: /health/live
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
readinessProbe:
httpGet:
path: /health/ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
---
apiVersion: v1
kind: Service
metadata:
name: hotplex
spec:
selector:
app: hotplex
ports:
- port: 80
targetPort: 8080配置参数
| 变量 | 默认值 | 描述 |
|---|---|---|
| PORT | 8080 | 服务端口 |
| LOG_LEVEL | info | 日志级别 |
| IDLE_TIMEOUT | 30m | 会话空闲超时时间 |
| OTEL_ENDPOINT | - | OpenTelemetry 接口地址 |
| MAX_SESSIONS | 1000 | 最大并发会话数 |