-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (48 loc) · 1.43 KB
/
docker-compose.yml
File metadata and controls
51 lines (48 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
version: '3.8'
services:
go4wol:
build: .
container_name: go4wol
restart: unless-stopped
network_mode: host # 使用host网络模式,确保能够发送广播包
# 注意:使用host网络模式时,ports映射会被忽略
ports:
- "52133:52133" # 在host网络模式下这行会被忽略,但保留以备切换到bridge模式
environment:
- PORT=52133
- ADMIN_PASSWORD=admin123 # 请修改为安全的密码
- TZ=Asia/Shanghai
volumes:
- ./data:/data:rw # 挂载数据目录到宿主机,确保读写权限
user: "1000:1000" # 使用与容器内相同的用户ID
labels:
- "traefik.enable=true"
- "traefik.http.routers.go4wol.rule=Host(`go4wol.local`)"
- "traefik.http.services.go4wol.loadbalancer.server.port=52133"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
image: kaiyuan/go4wol:latest
# 如果不能使用host网络模式,请使用以下配置
# services:
# go4wol:
# build: .
# container_name: go4wol
# restart: unless-stopped
# ports:
# - "52133:52133"
# environment:
# - PORT=52133
# - ADMIN_PASSWORD=your_secure_password
# - TZ=Asia/Shanghai
# volumes:
# - ./data:/data
# networks:
# - go4wol-network
# privileged: true # 可能需要特权模式来发送广播包
#
# networks:
# go4wol-network:
# driver: bridge