Skip to content

ade25/ade25-docker-traefik

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

About

This is as very simple docker configuration to run traefik locally for simple project handling. Traefik allows you to run multiple projects simultaneously without open port collisions.

Traefik is a HTTP proxy which automatically changes its own configuration whenever you spin up new docker containers. It then allows access to the web frontends by just passing all requests through itself, only needing one public port for all projects. To differentiate the projects it uses local domain names.

So for example:

Install

To get things up and running you just need to have docker installed:

Initial setup

b5 install
b5 update

Running the project

b5 run

Housekeeping

b5 update

In order to use the integrated TSL/SSL connection you need to generate a local self signed cert by using the provided script:

cd build/cert/
./create.sh

Your projects with traefik

To use traefik you will need to setup a local domain and adjust the project configuration accordingly.

Providing a local domain

Traefik needs a local domain to differentiate the projects you use. The domain name will make traefik choose the right backend container.

We use dnsmasq as a local nameservier for accomplishing that. Setup is as follows:

$ brew update  # make sure we are up to date
$ brew install dnsmasq  # install dnsmasq
$ cd $(brew --prefix)  # cd into /usr/local
$ mkdir -p etc  # make sure /usr/local/etc exists
$ echo 'address=/.a25dev/127.0.0.1' > etc/dnsmasq.conf  # setup local dns resolving
$ sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons  # Enable dnsmasq daemon
$ sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist  # And start the daemon ;-)
$ sudo mkdir -p /etc/resolver  # make sure /etc/resolver exists
$ sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/a25dev'  # tell macOS to use the local dnsmasq nameserver for .a25dev

A reboot might be needed for changes to take effect.

About

Docker Traefik DNS Mask Support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages