version: '3.8' services: dashgo: build: . container_name: dashgo ports: - "8080:8080" environment: - TZ=Asia/Shanghai volumes: - ./configs/config.yaml:/app/configs/config.yaml - ./data:/app/data - ./web/dist:/app/web/dist depends_on: mysql: condition: service_healthy redis: condition: service_started restart: unless-stopped healthcheck: test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/api/v1/guest/settings"] interval: 30s timeout: 10s retries: 3 start_period: 40s mysql: image: mysql:8.0 container_name: dashgo-mysql environment: MYSQL_ROOT_PASSWORD: dashgo_password MYSQL_DATABASE: dashgo MYSQL_CHARACTER_SET_SERVER: utf8mb4 MYSQL_COLLATION_SERVER: utf8mb4_unicode_ci volumes: - mysql_data:/var/lib/mysql # 端口映射已注释,MySQL 仅在 Docker 内部网络可访问 # 如需从主机访问 MySQL,取消下面的注释并修改端口(如 3307:3306) # ports: # - "3306:3306" restart: unless-stopped command: --default-authentication-plugin=mysql_native_password healthcheck: test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-pdashgo_password"] interval: 10s timeout: 5s retries: 5 start_period: 30s redis: image: redis:7-alpine container_name: dashgo-redis volumes: - redis_data:/data # 端口映射已注释,Redis 仅在 Docker 内部网络可访问 # 如需从主机访问 Redis,取消下面的注释并修改端口(如 6380:6379) # ports: # - "6379:6379" restart: unless-stopped healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 3s retries: 3 # sing-box 节点示例 singbox-node: image: ghcr.io/sagernet/sing-box:latest volumes: - ./configs/singbox-server.json:/etc/sing-box/config.json ports: - "8388:8388" # Shadowsocks - "10086:10086" # VMess - "443:443" # Trojan/VLESS - "9000:9000" # SSMAPI restart: unless-stopped command: ["run", "-c", "/etc/sing-box/config.json"] volumes: mysql_data: redis_data: