In order to complete this section of the lab you will need a domain name to use for testing. Additionally, ensure your DNS provider is listed in the available DNS Provider integrations section https://docs.traefik.io/v2.3/https/acme/#providers
- Ensure you have a domain name for testing
- Configure the DNS of your domain name to use your Docker server where you will run the below lab. Refer to your domain providers documentation.
- I've created the following DNS entries in Digital Ocean to perform all 3 labs. Please adjust your DNS according to where you host Docker and your DNS:
- Before we begin, lets cleanup any running Docker stack
docker stack rm traefik
If you named you stack something else use your specified name. If you don't remember rundocker stack ls
- Change to the
04-HTTPS-and-TLS
folder - Open the
traefik.http.yml
file in your favorite editor and review theChallenge HTTP
section - Edit the
traefik.http.yml
and edit youremail:
located in theChallenge HTTP
section - Open the
docker-compose.http.yml
file in your favorite editor and review thecatapp
section - Edit the
docker-compose.http.yml
catapp
section and add your domain here in the- "traefik.http.routers.catapp.rule=Host(
your_domain_here)"
label - Start Traefik and the
catapp
docker stack deploy -c docker-compose.yml traefik
- Open the Traefik Dashboard http://0.0.0.0:8080 and verify Traefik is running and
catapp
has TLS enabled. - Open the
catapp
using the domain you filled in at step 6. Remember to use HTTPS now https://your_domain_here.com - You should now see the
catapp
served with HTTPS and a proper Let's Encrypt Certificate
- Before we begin, lets cleanup the HTTP stack
docker stack rm traefik
If you named you stack something else use your specified name. If you don't remember rundocker stack ls
- Change to the
04-HTTPS-and-TLS
folder - Open the
traefik.tls.yml
file in your favorite editor and review theChallenge TLS
section - Edit the
traefik.tls.yml
and edit youremail:
located in theChallenge TLS
section - Open the
docker-compose.http.yml
file in your favorite editor and review thecatapp
section - Edit the
docker-compose.http.yml
catapp
section and add your domain here in the- "traefik.http.routers.catapp.rule=Host(
your_domain_here)"
label - Start Traefik and the
catapp
docker stack deploy -c docker-compose.yml traefik
- Open the Traefik Dashboard
http://your_domain_here:8080
and verify Traefik is running andcatapp
has TLS enabled. - Open the
catapp
using the domain you filled in at step 6. Remember to use HTTPS now https://your_domain_here.com - You should now see the
catapp
served with HTTPS and a proper Let's Encrypt Certificate
- Before we begin, lets cleanup the TLS stack
docker stack rm traefik
If you named you stack something else use your specified name. If you don't remember rundocker stack ls
- Change to the
04-HTTPS-and-TLS
folder - Log in to your DNS provider and collect the Authorization Tokens for your provider. Review the https://docs.traefik.io/v2.3/https/acme/#providers list to see which tokens you require for your provider. This step is unique to the DNS provider you are using.
- Copy the Authorization Tokens from your provider
- Open the
docker-compose.dns.yml
file in your favorite editor and review thetraefik
section - Edit the
Environment
section under theTraefik
service. - Paste the Authorization Tokens from your provider in this section. You may need different and/or additional fields here based on your provider.
environment:
- "DO_AUTH_TOKEN=<Your Super Secret Digital Ocean Token Goes here>"
- In the same
docker-compose.dns.yml
edit thecatapp
section and add your domain here in the- "traefik.http.routers.catapp.rule=Host(
your_domain_here)"
label - Open the
traefik.dns.yml
file in your favorite editor and review theChallenge DNS
section - Edit the
traefik.dns.yml
and edit youremail:
located in theChallenge DNS
section - Start Traefik and the
catapp
docker stack deploy -c docker-compose.yml traefik
- Open the Traefik Dashboard
http://your_domain_here:8080
and verify Traefik is running andcatapp
has TLS enabled. - Open the
catapp
using the domain you filled in at step 6. Remember to use HTTPS now https://your_domain_here.com - You should now see the
catapp
served with HTTPS and a proper Let's Encrypt Certificate
- Add a new DNS record to your DNS provider. Add
*.
in front of your domain*.you_domain.com
which enables all sub-domain certificates - Now that the Wildcard is configured for DNS, we can edit the Edit the
docker-compose.dns.yml
catapp
section and add your domain here in the- "traefik.http.routers.catapp.rule=Host(
your_domain_here)"
label. This time we will update the domain totraining.your_domain_here.com
- Open up
https://training.your_domain_here