example of :docker-compose.yml #12
Closed
Jasonzhang2023
started this conversation in
General
Replies: 1 comment
-
|
Docker 默认 bridge 网络模式,需要自己映射端口,至少映射两个端口,1. 面板端口(默认8081) 2. Hysteria2 端口,当Hysteria2 变更时,映射的端口也要跟着变,所以一步到位直接使用 host 模式,使用 host 模式运行时,可以指定 h-ui 的 web 服务端口,如果不指定则默认使用8081,docker compose 文件内容如下: version: '3'
services:
h-ui:
image: jonssonyan/h-ui
container_name: h-ui
restart: always
network_mode: host
volumes:
- /h-ui/bin:/h-ui/bin
- /h-ui/data:/h-ui/data
- /h-ui/export:/h-ui/export
- /h-ui/logs:/h-ui/logs
environment:
TZ: Asia/Shanghai
command: ./h-ui -p 8081最后加上 command 参数,-p 自定义 web 服务的端口 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
version: '3.3'
services:
h-ui:
image: jonssonyan/h-ui
container_name: h-ui
#network_mode: host
#当使用自定义端口的时候要把宿主机的模式关闭
ports:
- "38088:8081"
#- "127.0.0.1:38088:8081"
restart: always
volumes:
- /root/h-ui/bin:/h-ui/bin
- /root/h-ui/data:/h-ui/data
- /root/h-ui/export:/h-ui/export
- /root/h-ui/logs:/h-ui/logs
environment:
TZ: "Asia/Shanghai"
Beta Was this translation helpful? Give feedback.
All reactions