Exposing my microservices to the world wide web

  1. Basic Docker knowledge aquired.
  2. Running a service.
  3. The service is accessible from local network.
  4. Now how do I reach it from the outside?

1. Setting up Traefik

Traefic is a reverse proxy service that will make your life easier dealing with your container networking. Their basic example using Docker is a good start.

2. Exposing server to the world wide web

I find the easiest solution to circumvent any infrastructure problems is to dedicate an IP address with your VPN provider. That way you can access your server on a static IP. You could also use a VPN service like Tailscale if you want to limit the access.

3. Securing connections with TLS

Docker-compose with let’s encrypt: TLS Challenge.

Now I can access my service with https from anywhere. I use Traefik to route domains to specific services and the Traefik Dashboard gives a nice overview of all the connected services.

A very simple setup.

4. Optional next step: Restrict access

In case you don’t want public access to your service that is now accessible from anywhere, Traefik offers middlewares to put your service behind authentication like BasicAuth.