Traefik + Docker is a great set up for developing microservice architectures

Member-only story

Docker + Traefik

Create a microservice architecture and handle routing

Eric Fossas
5 min readAug 19, 2018

Docker is a container management tool and Traefik is a reverse proxy for managing the routing between containers. With both tools, you can create a microservice architecture.

This quick tutorial will focus on developing with Docker and Traefik. Thus, it won’t go over Docker swarm mode very much (which is for running Docker on multiple machines).

I’ll be using this repo for the tutorial: https://github.com/efossas/CRUD. It’s for creating a CRUD application. It’s super simple to set up. Run the commands below and set up DNS to route crud.docker.localhost & traefik.docker.localhost to localhost (127.0.0.1). The easy way to do that is to edit /etc/hosts

git clone https://github.com/efossas/CRUD 
cd CRUD
docker-compose up -d

Btw, it helps to have a strong understanding of how Unix shells work to really understand Docker.

Containers as far as the eye can see!

What This Tutorial Covers

  1. Docker basics
  2. Building a Docker image
  3. Docker terminology
  4. Using Docker Compose
  5. Using Traefik with Docker

What You Need For This Tutorial

Docker

Docker (Basics)

Docker is a set of tools for managing containers. A container is essentially a sandboxed user level operating system with a single running process.

Run the following command and you will be put inside a container with the Alpine operating system. It’s running process is the ASH unix shell, so you can run typical commands like ls, cd, pwd, etc. To exit the container, run exit.

docker run -it alpine

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Responses (3)

Write a response