Sign inSign up

tcjj3/ngrok_docker

By tcjj3

Updated over 5 years ago

Docker for setup websites, using ngrok.

Image
0

1.1K

tcjj3/ngrok_docker repository overview

ngrok_Docker

Docker for setup websites, using ngrok.

Start:

  1. Install docker-ce:
[tcjj3@debian]$ sudo apt install -y curl
[tcjj3@debian]$ curl -fsSL get.docker.com -o get-docker.sh
[tcjj3@debian]$ sudo sh get-docker.sh
[tcjj3@debian]$ sudo groupadd docker
[tcjj3@debian]$ sudo usermod -aG docker $USER
[tcjj3@debian]$ sudo systemctl enable docker && sudo systemctl start docker


  1. Run ngrok_Docker:
sudo docker run -d -i -t \
 --restart always \
 --name=ngrok_website \
 -e AUTHTOKEN=xxxxxxxxxxxxxxxxxx \
 -e REGION=us \
 -e PROTOCOL=http \
 -e SUBDOMAIN=test \
 -e HOST="http://192.168.1.1:80" \
 -p 4040:4041 \
 tcjj3/ngrok_docker:latest

In this case, AUTHTOKEN environment variable is "xxxxxxxxxxxxxxxxxx", you can get your authtoken from ngrok site by register an account.

If you want to choose the server region, just set the REGION environment variable to one of the following string: us, eu, au, ap, sa, jp, in. The default server region is "us".

The region explains are:

    us - United States (Ohio)       ->  *.ngrok.io
    eu - Europe (Frankfurt)         ->  *.eu.ngrok.io
    ap - Asia/Pacific (Singapore)   ->  *.ap.ngrok.io
    au - Australia (Sydney)         ->  *.au.ngrok.io
    sa - South America (Sao Paulo)  ->  *.sa.ngrok.io
    jp - Japan (Tokyo)              ->  *.jp.ngrok.io
    in - India (Mumbai)             ->  *.in.ngrok.io

The PROTOCOL environment variable is "http" (or can be "tcp").

If PROTOCOL environment variable is "http", just set SUBDOMAIN environment variable to the name you wish for domain ".ngrok.io".
For example, the SUBDOMAIN environment variable is "test", and the domain depends on the REGION environment variable, are:

    us - test.ngrok.io      ->  http://test.ngrok.io/ or https://test.ngrok.io/
    eu - test.eu.ngrok.io   ->  http://test.eu.ngrok.io/ or https://test.eu.ngrok.io/
    ap - test.ap.ngrok.io   ->  http://test.ap.ngrok.io/ or https://test.ap.ngrok.io/
    au - test.au.ngrok.io   ->  http://test.au.ngrok.io/ or https://test.au.ngrok.io/
    sa - test.sa.ngrok.io   ->  http://test.sa.ngrok.io/ or https://test.sa.ngrok.io/
    jp - test.jp.ngrok.io   ->  http://test.jp.ngrok.io/ or https://test.jp.ngrok.io/
    in - test.in.ngrok.io   ->  http://test.in.ngrok.io/ or https://test.in.ngrok.io/

If PROTOCOL environment variable is "tcp", just set REMOTE_ADDR environment variable to the remote address included port, such as "1.tcp.ngrok.io:27210".

And the HOST environment variable can be just "a local port", "host:port", or "http(s)://host:port (when PROTOCOL is http)".

Finally, the port "4041" in the container is the "HTTP Web Interface" of ngrok, and forwarded by nginx, you can find your "tunnel URLs" in this page (such as http://127.0.0.1:4040/). If you don't need this port, just remove the 4041 port forward argument.

Tag summary

Content type

Image

Digest

Size

76.1 MB

Last updated

over 5 years ago

docker pull tcjj3/ngrok_docker