Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guide for Docker, Traefik & Letsencrypt #1923

Merged
merged 5 commits into from
Aug 21, 2017
Merged

Conversation

mvdstam
Copy link
Contributor

@mvdstam mvdstam commented Aug 6, 2017

As requested by @idez in #1922. I hope to contribute more in the future regarding documenting Traefik. 👍

@ldez ldez added this to the 1.4 milestone Aug 6, 2017
@ldez
Copy link
Contributor

ldez commented Aug 6, 2017

@mvdstam Thanks!

Could fix the build?

Errors from misspell:
docs/user-guide/getting-started-with-docker-and-lets-encrypt.md:86:12: "mimimum" is a misspelling of "minimum"

Please fix the above errors. You can test via "misspell" and commit the result.

@mvdstam
Copy link
Contributor Author

mvdstam commented Aug 6, 2017

@ldez Done!

@ldez ldez added the area/acme label Aug 6, 2017
Copy link
Contributor

@nmengin nmengin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for his great contribution.
Sure this user guide will be very helpful for a lot of users.

A few comments...

In this use case, we want to use Traefik as a *layer-7* load balancer with SSL termination for a set of microservices used to run a webapplication. We also want to automatically *discover any services* on the Docker host and let Traefik reconfigure itself automatically when containers get created (or shut down) so HTTP traffic can be routed accordingly. In addition, we want to use Let's Encrypt to automatically generate and renew SSL certificates per hostname.

## Setting up
In order for this to work, you'll need a server with a public IP address, with Docker installed on it. In this example, we're using the fictitious domain *my-awesome-app.org". In real-life, you'll want to use your own domain and have the DNS configured accordingly so the hostname records you'll want to use point to the aforementioned public IP address.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The character " has to be replaced by a character * to terminate the italic section.


```sh
$ touch /opt/traefik/docker-compose.yml
$ touch /opt/traefik/acme.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The acme.json file must only be accessed in read/wrie by the owner that why it should be better to set these commands :
touch /opt/traefik/acme.json && chmod 600 /opt/traefik/acme.json

- Log `ERROR`-level messages (or more severe) to the console, but silence `DEBUG`-level messagse
- Check for new versions of Traefik periodically
- Create two entrypoints, namely an `HTTP` endpoint on port `80`, and an `HTTPS` endpoint on port `443` where all incoming traffic on port `80` will immediately get redirected to `HTTPS`.
- Enable the Docker configuration backend and listen for container events on the Docker unix socket we've mounted earlier. However, **new containers will not be exposed by Traefik by default, we'll get into this in a bit!*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A * character is missing at the end of the line to terminate the bold section.

@mvdstam
Copy link
Contributor Author

mvdstam commented Aug 16, 2017

@nmengin I've updated the PR with your requested changes. The remark you made regarding the restart policy seems unnecessary as this is a well-documented (and well-understood) feature within Docker and I see no reason to change that in the example I described in the document. Especially since the example describes the setup of a front-facing reverse proxy like Traefik, I wouldn't understand why you wouldn't want the restart policy on anything else than always.

@nmengin
Copy link
Contributor

nmengin commented Aug 17, 2017

@mvdstam It was just a suggestion. Of course, for a user guide, the type of restart policy is not really important. I should say might be instead of may be 😉

Copy link
Contributor

@nmengin nmengin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@emilevauge emilevauge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @mvdstam !
LGTM

@ldez
Copy link
Contributor

ldez commented Aug 21, 2017

@mvdstam
Copy link
Contributor Author

mvdstam commented Aug 21, 2017

@ldez Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants