1

I am creating a SaaS project that lets end-users run and access a dashboard as a web app which is a Docker container, which means every user has his own dashboard which is a running docker container, and I would like them to access their servers/containers using my domain (HTTP) as follow: user1: subdomain.mydomain.com/user1app, user2: subdomain.mydomain.com/user1app, etc.

Currently, I am using LocalTunnel however it is not stable and requires me to use 1 subdomain for every user, for example: user1.mydomain.com, user2.mydomain.com, etc. but what if we scale and get more users? I need a dynamic and automatic way to create users custom URL link to expose their running docker containers and give them access such as, subdomain.mydomain.com/user123, subdomain.mydomain.com/user456, etc.

I tried to use ngrok, however, it is limited in many ways e.g. 40-requests/minute limit, and not free. Thanks

  • Just to clarify, the 40 connections/min limit only applies to free ngrok accounts. Paid accounts do have higher limits. – Andrew Benton Apr 05 '21 at 23:44

2 Answers2

0

I recommend running an nginx-revsere-proxy with docker and the you can host as many webapp as you want only with one single ip.

https://github.com/nginx-proxy/nginx-proxy

There you can add per host configs or even change the default configuration. So you can write for each dashboard a config or use variables and a bashscript to create the host configs

jonny172
  • 11
  • 1
  • Thank you for your answer! I would like to make it dynamically configured, plus some servers are running locally and I would like to expose them through tunneling. – Khaireddine Mejri Apr 08 '21 at 08:50
  • Yeah, the this reverse proxy is looking for new container and then set up all automatically. Everything is controlled via environnement variables and there you also could set it, that itβ€˜s only internaly reachable. – jonny172 Apr 09 '21 at 13:00
0

If you have multiple docker containers running locally, you can expose them to the internet using ngrok.

First, install ngrok:

$ npm install -g ngrok

Then, start ngrok and specify the port that your docker container is running on:

$ ngrok http 80

Ngrok will give you a URL that you can use to access your docker container from the internet.