Files
huobao-drama/docker-compose.yml
ShellMonster 3d6dda8a17 feat: 添加Docker国内镜像源配置支持
- 使用Build Args方式保持Dockerfile通用性
- 支持Docker Hub、npm、Go代理、Alpine apk镜像源配置
- 添加.env.example配置示例文件
- 更新README添加镜像源使用说明

配置方式:
1. 复制 .env.example 为 .env
2. 取消注释需要的镜像源配置
3. 运行 docker compose build

支持的镜像源:
- DOCKER_REGISTRY: Docker Hub 镜像前缀
- NPM_REGISTRY: npm 包镜像源
- GO_PROXY: Go 模块代理
- ALPINE_MIRROR: Alpine apk 镜像源
2026-01-20 11:06:30 +08:00

50 lines
1.5 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
huobao-drama:
image: huobao-drama:latest
container_name: huobao-drama
build:
context: .
dockerfile: Dockerfile
args:
# Docker Hub 镜像源(注意末尾斜杠)
DOCKER_REGISTRY: ${DOCKER_REGISTRY:-}
# npm 镜像源
NPM_REGISTRY: ${NPM_REGISTRY:-}
# Go 代理
GO_PROXY: ${GO_PROXY:-}
# Alpine apk 镜像源
ALPINE_MIRROR: ${ALPINE_MIRROR:-}
ports:
- "5678:5678"
volumes:
# 持久化数据目录(使用命名卷,容器内以 root 运行)
- huobao-data:/app/data
# 挂载配置文件(可选,如需自定义配置请取消注释)
# - ./configs/config.yaml:/app/configs/config.yaml:ro
# 注意:如果使用本地目录挂载,需要确保目录权限正确
# 例如:- ./data:/app/data (需要 chmod 777 ./data
environment:
- TZ=Asia/Shanghai
# 访问宿主机服务说明:
# 使用 host.docker.internal 代替 127.0.0.1
# 例如http://host.docker.internal:11434 (Ollama)
extra_hosts:
- "host.docker.internal:host-gateway" # 统一支持所有平台
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:5678/health"]
interval: 30s
timeout: 3s
retries: 3
start_period: 10s
networks:
- huobao-network
volumes:
huobao-data:
driver: local
networks:
huobao-network:
driver: bridge