Merge branch v2.11 into v3.0
This commit is contained in:
commit
a69c1ba3b7
112 changed files with 1133 additions and 238 deletions
|
@ -3,9 +3,9 @@ title: "Traefik Docker DNS Challenge Documentation"
|
|||
description: "Learn how to create a certificate with the Let's Encrypt DNS challenge to use HTTPS on a Service exposed with Traefik Proxy. Read the tehnical documentation."
|
||||
---
|
||||
|
||||
# Docker-compose with let's encrypt: DNS Challenge
|
||||
# Docker-compose with Let's Encrypt: DNS Challenge
|
||||
|
||||
This guide aim to demonstrate how to create a certificate with the let's encrypt DNS challenge to use https on a simple service exposed with Traefik.
|
||||
This guide aim to demonstrate how to create a certificate with the Let's Encrypt DNS challenge to use https on a simple service exposed with Traefik.
|
||||
Please also read the [basic example](../basic-example) for details on how to expose such a service.
|
||||
|
||||
## Prerequisite
|
||||
|
@ -52,7 +52,7 @@ For the DNS challenge, you'll need:
|
|||
!!! Note
|
||||
|
||||
If you uncommented the `acme.caserver` line, you will get an SSL error, but if you display the certificate and see it was emitted by `Fake LE Intermediate X1` then it means all is good.
|
||||
(It is the staging environment intermediate certificate used by let's encrypt).
|
||||
(It is the staging environment intermediate certificate used by Let's Encrypt).
|
||||
You can now safely comment the `acme.caserver` line, remove the `letsencrypt/acme.json` file and restart Traefik to issue a valid certificate.
|
||||
|
||||
## Explanation
|
||||
|
@ -69,7 +69,7 @@ ports:
|
|||
- "443:443"
|
||||
```
|
||||
|
||||
- We configure the DNS let's encrypt challenge:
|
||||
- We configure the DNS Let's Encrypt challenge:
|
||||
|
||||
```yaml
|
||||
command:
|
||||
|
@ -77,7 +77,7 @@ command:
|
|||
- "--certificatesresolvers.myresolver.acme.dnschallenge=true"
|
||||
# Tell which provider to use
|
||||
- "--certificatesresolvers.myresolver.acme.dnschallenge.provider=ovh"
|
||||
# The email to provide to let's encrypt
|
||||
# The email to provide to Let's Encrypt
|
||||
- "--certificatesresolvers.myresolver.acme.email=postmaster@example.com"
|
||||
```
|
||||
|
||||
|
@ -175,7 +175,7 @@ services:
|
|||
- "ovh_consumer_key"
|
||||
```
|
||||
|
||||
- The environment variable within our `whoami` service are suffixed by `_FILE` which allow us to point to files containing the value, instead of exposing the value itself.
|
||||
- The environment variable within our `traefik` service are suffixed by `_FILE` which allow us to point to files containing the value, instead of exposing the value itself.
|
||||
The acme client will read the content of those file to get the required configuration values.
|
||||
|
||||
```yaml
|
||||
|
|
|
@ -3,9 +3,9 @@ title: "Traefik Docker HTTP Challenge Documentation"
|
|||
description: "Learn how to create a certificate with the Let's Encrypt HTTP challenge to use HTTPS on a Service exposed with Traefik Proxy. Read the technical documentation."
|
||||
---
|
||||
|
||||
# Docker-compose with let's encrypt : HTTP Challenge
|
||||
# Docker-compose with Let's Encrypt : HTTP Challenge
|
||||
|
||||
This guide aim to demonstrate how to create a certificate with the let's encrypt HTTP challenge to use https on a simple service exposed with Traefik.
|
||||
This guide aim to demonstrate how to create a certificate with the Let's Encrypt HTTP challenge to use https on a simple service exposed with Traefik.
|
||||
Please also read the [basic example](../basic-example) for details on how to expose such a service.
|
||||
|
||||
## Prerequisite
|
||||
|
@ -38,7 +38,7 @@ For the HTTP challenge you will need:
|
|||
!!! Note
|
||||
|
||||
If you uncommented the `acme.caserver` line, you will get an SSL error, but if you display the certificate and see it was emitted by `Fake LE Intermediate X1` then it means all is good.
|
||||
(It is the staging environment intermediate certificate used by let's encrypt).
|
||||
(It is the staging environment intermediate certificate used by Let's Encrypt).
|
||||
You can now safely comment the `acme.caserver` line, remove the `letsencrypt/acme.json` file and restart Traefik to issue a valid certificate.
|
||||
|
||||
## Explanation
|
||||
|
@ -55,7 +55,7 @@ ports:
|
|||
- "443:443"
|
||||
```
|
||||
|
||||
- We configure the HTTPS let's encrypt challenge:
|
||||
- We configure the HTTPS Let's Encrypt challenge:
|
||||
|
||||
```yaml
|
||||
command:
|
||||
|
@ -63,7 +63,7 @@ command:
|
|||
- "--certificatesresolvers.myresolver.acme.httpchallenge=true"
|
||||
# Tell it to use our predefined entrypoint named "web"
|
||||
- "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"
|
||||
# The email to provide to let's encrypt
|
||||
# The email to provide to Let's Encrypt
|
||||
- "--certificatesresolvers.myresolver.acme.email=postmaster@example.com"
|
||||
```
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@ title: "Traefik Docker TLS Challenge Documentation"
|
|||
description: "Learn how to create a certificate with the Let's Encrypt TLS challenge to use HTTPS on a service exposed with Traefik Proxy. Read the technical documentation."
|
||||
---
|
||||
|
||||
# Docker-compose with let's encrypt: TLS Challenge
|
||||
# Docker-compose with Let's Encrypt: TLS Challenge
|
||||
|
||||
This guide aim to demonstrate how to create a certificate with the let's encrypt TLS challenge to use https on a simple service exposed with Traefik.
|
||||
This guide aim to demonstrate how to create a certificate with the Let's Encrypt TLS challenge to use https on a simple service exposed with Traefik.
|
||||
Please also read the [basic example](../basic-example) for details on how to expose such a service.
|
||||
|
||||
## Prerequisite
|
||||
|
@ -38,7 +38,7 @@ For the TLS challenge you will need:
|
|||
!!! Note
|
||||
|
||||
If you uncommented the `acme.caserver` line, you will get an SSL error, but if you display the certificate and see it was emitted by `Fake LE Intermediate X1` then it means all is good.
|
||||
(It is the staging environment intermediate certificate used by let's encrypt).
|
||||
(It is the staging environment intermediate certificate used by Let's Encrypt).
|
||||
You can now safely comment the `acme.caserver` line, remove the `letsencrypt/acme.json` file and restart Traefik to issue a valid certificate.
|
||||
|
||||
## Explanation
|
||||
|
@ -55,7 +55,7 @@ ports:
|
|||
- "443:443"
|
||||
```
|
||||
|
||||
- We configure the Https let's encrypt challenge:
|
||||
- We configure the TLS Let's Encrypt challenge:
|
||||
|
||||
```yaml
|
||||
command:
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
---
|
||||
title: "Traefik Docker Documentation"
|
||||
description: "This guide covers a Docker Compose file exposing a service using the Docker provider in Traefik Proxy. Read the technical documentation."
|
||||
description: "Learn how to use Docker Compose to expose a service with Traefik Proxy."
|
||||
---
|
||||
|
||||
# Docker Compose example
|
||||
|
||||
In this section, we quickly go over a Docker Compose file exposing a service using the Docker provider.
|
||||
This will also be used as a starting point for the other Docker Compose guides.
|
||||
In this section, you will learn how to use [Docker Compose](https://docs.docker.com/compose/ "Link to Docker Compose") to expose a service using the Docker provider.
|
||||
|
||||
## Setup
|
||||
|
||||
- Edit a `docker-compose.yml` file with the following content:
|
||||
Create a `docker-compose.yml` file with the following content:
|
||||
|
||||
```yaml
|
||||
--8<-- "content/user-guides/docker-compose/basic-example/docker-compose.yml"
|
||||
|
@ -45,33 +44,44 @@ This will also be used as a starting point for the other Docker Compose guides.
|
|||
|
||||
```
|
||||
|
||||
- Replace `whoami.localhost` by your **own domain** within the `traefik.http.routers.whoami.rule` label of the `whoami` service.
|
||||
- Run `docker-compose up -d` within the folder where you created the previous file.
|
||||
- Wait a bit and visit `http://your_own_domain` to confirm everything went fine.
|
||||
You should see the output of the whoami service. Something similar to:
|
||||
Replace `whoami.localhost` by your **own domain** within the `traefik.http.routers.whoami.rule` label of the `whoami` service.
|
||||
|
||||
```text
|
||||
Hostname: d7f919e54651
|
||||
IP: 127.0.0.1
|
||||
IP: 192.168.64.2
|
||||
GET / HTTP/1.1
|
||||
Host: whoami.localhost
|
||||
User-Agent: curl/7.52.1
|
||||
Accept: */*
|
||||
Accept-Encoding: gzip
|
||||
X-Forwarded-For: 192.168.64.1
|
||||
X-Forwarded-Host: whoami.localhost
|
||||
X-Forwarded-Port: 80
|
||||
X-Forwarded-Proto: http
|
||||
X-Forwarded-Server: 7f0c797dbc51
|
||||
X-Real-Ip: 192.168.64.1
|
||||
```
|
||||
Now run `docker-compose up -d` within the folder where you created the previous file.
|
||||
This will start Docker Compose in background mode.
|
||||
|
||||
!!! info "This can take a moment"
|
||||
|
||||
Docker Compose will now create and start the services declared in the `docker-compose.yml`.
|
||||
|
||||
Wait a bit and visit `http://your_own_domain` to confirm everything went fine.
|
||||
|
||||
You should see the output of the whoami service.
|
||||
It should be similar to the following example:
|
||||
|
||||
```text
|
||||
Hostname: d7f919e54651
|
||||
IP: 127.0.0.1
|
||||
IP: 192.168.64.2
|
||||
GET / HTTP/1.1
|
||||
Host: whoami.localhost
|
||||
User-Agent: curl/7.52.1
|
||||
Accept: */*
|
||||
Accept-Encoding: gzip
|
||||
X-Forwarded-For: 192.168.64.1
|
||||
X-Forwarded-Host: whoami.localhost
|
||||
X-Forwarded-Port: 80
|
||||
X-Forwarded-Proto: http
|
||||
X-Forwarded-Server: 7f0c797dbc51
|
||||
X-Real-Ip: 192.168.64.1
|
||||
```
|
||||
|
||||
## Details
|
||||
|
||||
- As an example, we use [whoami](https://github.com/traefik/whoami "Link to the GitHub repo of whoami") (a tiny Go server that prints OS information and HTTP request to output) which was used to define our `simple-service` container.
|
||||
Let's break it down and go through it, step-by-step.
|
||||
|
||||
- We define an entry point, along with the exposure of the matching port within Docker Compose, which allow us to "open and accept" HTTP traffic:
|
||||
You use [whoami](https://github.com/traefik/whoami "Link to the GitHub repo of whoami"), a tiny Go server that prints OS information and HTTP request to output as service container.
|
||||
|
||||
Second, you define an entry point, along with the exposure of the matching port within Docker Compose, which allows to "open and accept" HTTP traffic:
|
||||
|
||||
```yaml
|
||||
command:
|
||||
|
@ -82,7 +92,7 @@ ports:
|
|||
- "80:80"
|
||||
```
|
||||
|
||||
- We expose the Traefik API to be able to check the configuration if needed:
|
||||
Third, you expose the Traefik API to be able to check the configuration if needed:
|
||||
|
||||
```yaml
|
||||
command:
|
||||
|
@ -101,7 +111,7 @@ ports:
|
|||
curl -s 127.0.0.1:8080/api/rawdata | jq .
|
||||
```
|
||||
|
||||
- We allow Traefik to gather configuration from Docker:
|
||||
Fourth, you allow Traefik to gather configuration from Docker:
|
||||
|
||||
```yaml
|
||||
traefik:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue