Files
docker-apps/mihomo/docker-compose.yml
2026-03-20 10:48:59 +08:00

28 lines
1.0 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.
version: '3.8'
services:
# Mihomo 服务(核心)
mihomo:
image: metacubex/mihomo:latest # 官方最新镜像
container_name: mihomo
restart: always # 容器异常退出时自动重启
network_mode: host # 使用主机网络(推荐,避免端口映射问题)
volumes:
# 挂载本地配置文件到容器内(核心!需确保本地有 config.yaml
- ./config.yaml:/root/.config/mihomo/config.yaml
# 可选:挂载日志目录(如需查看日志)
- ./logs:/root/.config/mihomo/logs
environment:
- TZ=Asia/Shanghai # 设置时区为上海
# 可选:限制资源使用
# Yacd 面板服务(可视化管理)
yacd:
image: haishanh/yacd:latest # Yacd 官方镜像
container_name: yacd
restart: always
ports:
- "8090:80" # 宿主机 9090 端口映射到容器 80 端口(可自定义宿主机端口)
environment:
- TZ=Asia/Shanghai
depends_on:
- mihomo # 确保 Mihomo 先启动在yacd中填写mihomo的apibaseurl应该是什么