Docker部署ngrok反向代理

dhso
2019/05/27 12:22
统计中

dhso/ngrok

Another ngrok client by python.

start ngrokd service

docker run -d \
--name ngrokd \
--net=host \
--restart=always \
sequenceiq/ngrokd:latest \
-httpAddr=:4480 \
-httpsAddr=:4444 \
-domain=xxx.com

Please remember to modify your domain name resolution

A | *.xxx.com | xxx.xxx.xxx.xxx

run ngrok client

docker run -d \
--name ngrok \
--net=host \
--restart=always \
-e NGROK_HOST=xxx.com|xxx.xxx.xxx.xxx \
-e NGROK_PORT=4443 \
-e NGROK_BUFSIZE=8192 \
-v ngrok_app:/app \
dhso/ngrok:latest

config

ENV VAL
NGROK_HOST your ngrokd domain or IP
NGROK_PORT default 4443
NGROK_BUFSIZE default 8192
in ngrok container
cd /app
edit ngrok.json
save ngrok.json and restart ngrok container

ngrok.json example

[{
    "protocol": "http",
    "hostname": "www.xxx.com",
    "subdomain": "",
    "rport": 0,
    "lhost": "127.0.0.1",
    "lport": 80
},{
    "protocol": "http",
    "hostname": "",
    "subdomain": "www",
    "rport": 0,
    "lhost": "127.0.0.1",
    "lport": 80
},{
    "protocol": "tcp",
    "hostname": "",
    "subdomain": "",
    "rport": 2222,
    "lhost": "127.0.0.1",
    "lport": 22
}]

Hub地址 https://hub.docker.com/r/dhso/ngrok
Github地址 https://github.com/dhso/ngrok-python

本文为 dhso 原创

发布在 http://blog.minws.com/dockerbu-shu-ngrokfan-xiang-dai-li/

如有转载,请标明来源!

作者信息
姓名:dhso
热评文章
最新评论
文章概览