version: '3.8' services: ccload: build: context: . dockerfile: Dockerfile args: # 版本号:用于静态资源缓存控制 # - dev(默认):开发环境,静态资源不缓存 # - v1.x.x:生产环境,静态资源长缓存 # 生产构建: VERSION=$(git describe --tags --always) docker-compose -f docker-compose.build.yml build VERSION: ${VERSION:-dev} image: ccload:local container_name: ccload restart: unless-stopped ports: - "8080:8080" environment: - PORT=8080 - SQLITE_PATH=/app/data/ccload.db - GIN_MODE=release # 必填:未设置将无法启动 - CCLOAD_PASS=your_admin_password # 可选:启动时预置 API 访问令牌,格式 token 或 token|描述,逗号分隔 # - CCLOAD_API_TOKENS=token1|production,token2|development # API访问令牌也可通过Web界面管理: http://localhost:8080/web/tokens.html volumes: - ccload_data:/app/data healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s volumes: ccload_data: driver: local