Easy local tunnel with docker environment

qelphybox

Kirill Bobykin

Posted on August 26, 2021

Easy local tunnel with docker environment

Why?

  • You can provide demo for your web application from development environment
  • You can use domain and https connection for test purposes
  • It is pretty easy to setup

How?

Try to use tunnel services like ngrok, localtunnel, etc...

You can check it with docker-compose. Setup docker-compose.yml, for example:

# docker-compose.yml
version: '3.8'

services:
  server:
    image: nginxdemos/hello
    ports: 
      - 80

  localtunnel:
    image: efrecon/localtunnel
    restart: on-failure
    command:
      --local-host server --port 80 --subdomain $SUBDOMAIN
    environment: 
      - SUBDOMAIN=megauniquedomain
    links:
      - server
    depends_on:
      - server
Enter fullscreen mode Exit fullscreen mode

Run this config with docker-compose up -d
Then check https://megauniquedomain.loca.lt/ you will meet your server root page.

How does it work?

I found great answer on stackoverflow for you!

💖 💪 🙅 🚩
qelphybox
Kirill Bobykin

Posted on August 26, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Easy local tunnel with docker environment
localtunnel Easy local tunnel with docker environment

August 26, 2021