Changes for page Traefik

Last modified by chrisby on 2024/03/03 14:54

From version 1.3
edited by chrisby
on 2024/03/03 14:54
Change comment: There is no comment for this version
To version 1.1
edited by chrisby
on 2023/10/27 19:27
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,30 +1,32 @@
1 1  Traefik is usually included in the other [[Software Stacks|doc:Software Stacks.WebHome]], but this page is for special use cases.
2 2  
3 -###### Redirect from HTTP to HTTPS
3 +### Redirect from HTTP to HTTPS
4 4  
5 - traefik:
6 - image: "traefik:latest"
7 - container_name: "traefik"
8 - restart: unless-stopped
9 - command:
10 - - "--api.insecure=true"
11 - - "--providers.docker=true"
12 - - "--providers.docker.exposedbydefault=false"
13 - - "--entrypoints.websecure.address=:443"
14 - - "--certificatesresolvers.myresolver.acme.tlschallenge=true"
15 - - "--certificatesresolvers.myresolver.acme.email=<EMAIL>"
16 - - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
17 - # This enables redirect from HTTP to HTTPS
18 - - "--entrypoints.web.address=:80"
19 - - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
20 - - "--entrypoints.web.http.redirections.entryPoint.scheme=https"
21 - - "--entrypoints.web.http.redirections.entryPoint.permanent=true"
22 - # Uncomment for test mode. This allows detailed logging and creation of a fake certificate.
23 - # - "--log.level=DEBUG"
24 - # - "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
25 - ports:
26 - - "80:80"
27 - - "443:443"
28 - volumes:
29 - - "./data/traefik/letsencrypt:/letsencrypt"
30 - - "/var/run/docker.sock:/var/run/docker.sock:ro"
5 +```yaml
6 +traefik:
7 + image: "traefik:latest"
8 + container_name: "traefik"
9 + restart: unless-stopped
10 + command:
11 + - "--api.insecure=true"
12 + - "--providers.docker=true"
13 + - "--providers.docker.exposedbydefault=false"
14 + - "--entrypoints.websecure.address=:443"
15 + - "--certificatesresolvers.myresolver.acme.tlschallenge=true"
16 + - "--certificatesresolvers.myresolver.acme.email=<EMAIL>"
17 + - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
18 + # This enables redirect from HTTP to HTTPS
19 + - "--entrypoints.web.address=:80"
20 + - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
21 + - "--entrypoints.web.http.redirections.entryPoint.scheme=https"
22 + - "--entrypoints.web.http.redirections.entryPoint.permanent=true"
23 + # Uncomment for test mode. This allows detailed logging and creation of a fake certificate.
24 + # - "--log.level=DEBUG"
25 + # - "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
26 + ports:
27 + - "80:80"
28 + - "443:443"
29 + volumes:
30 + - "./data/traefik/letsencrypt:/letsencrypt"
31 + - "/var/run/docker.sock:/var/run/docker.sock:ro"
32 +```