Add more traefik v2.1 and v1.7 examples
rodzic
e39a0726ef
commit
e88242d9fe
|
@ -1,7 +0,0 @@
|
|||
|
||||
docker-compose -f traefik-v1.7-dashboard.yml up
|
||||
docker-compose -f traefik-v2.1-dashboard.yml up
|
||||
docker-compose -f traefik-v1.7-dashboard-with-basic-auth.yml up
|
||||
docker-compose -f traefik-v2.1-dashboard-with-basic-auth.yml up
|
||||
docker-compose -f traefik-v1.7-nginx-backend.yml up
|
||||
docker-compose -f traefik-v2.1-nginx-backend.yml up
|
|
@ -0,0 +1,11 @@
|
|||
Traefik v1.7 vs v2.1 configurations
|
||||
===================================
|
||||
|
||||
Some traefik configurations to see differences between v1.7 and v2.1
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
```bash
|
||||
docker-compose -f traefik-v1.7-dashboard-https.yml up
|
||||
```
|
|
@ -6,24 +6,21 @@ services:
|
|||
image: traefik:v1.7
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
command:
|
||||
- --entrypoints=Name:http Address::80
|
||||
- --entrypoints=Name:https Address::443 TLS
|
||||
- --docker
|
||||
- --docker.watch
|
||||
- --docker.exposedbydefault=false
|
||||
- --logLevel=DEBUG
|
||||
- --api
|
||||
labels:
|
||||
traefik.enable: 'true'
|
||||
traefik.port: 8080
|
||||
traefik.frontend.rule: Host:traefik-ui.local
|
||||
traefik.enable: 'true'
|
||||
traefik.frontend.auth.basic.users: traefik_user:$$apr1$$epoKf5li$$QfTMJZOCS/halv3CiIUEu0
|
||||
traefik.frontend.redirect.entryPoint: https
|
||||
traefik.frontend.entryPoints: http,https
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
nginx:
|
||||
image: nginx:1.17.8-alpine
|
||||
labels:
|
||||
traefik.enable: 'true'
|
||||
traefik.frontend.rule: Host:nginx.local
|
||||
traefik.frontend.entryPoints: http
|
||||
traefik.port: 80
|
|
@ -17,5 +17,6 @@ services:
|
|||
traefik.frontend.rule: Host:traefik-ui.local
|
||||
traefik.enable: 'true'
|
||||
traefik.frontend.auth.basic.users: traefik_user:$$apr1$$epoKf5li$$QfTMJZOCS/halv3CiIUEu0
|
||||
traefik.frontend.entryPoints: http
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
|
@ -16,5 +16,6 @@ services:
|
|||
traefik.port: 8080
|
||||
traefik.frontend.rule: Host:traefik-ui.local
|
||||
traefik.enable: 'true'
|
||||
traefik.frontend.entryPoints: http
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
|
@ -0,0 +1,35 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
|
||||
traefik:
|
||||
image: traefik:v1.7
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
command:
|
||||
- --entrypoints=Name:http Address::80
|
||||
- --entrypoints=Name:https Address::443 TLS
|
||||
- --docker
|
||||
- --docker.exposedbydefault=false
|
||||
- --logLevel=DEBUG
|
||||
- --acme.email=you@mail.com
|
||||
- --acme.storage=/etc/traefik/acme.json
|
||||
- --acme.entryPoint=http
|
||||
- --acme.onHostRule=true
|
||||
- --acme.httpchallenge.entrypoint=http
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- conf:/etc/traefik
|
||||
|
||||
nginx:
|
||||
image: nginx:1.17.8-alpine
|
||||
labels:
|
||||
traefik.enable: 'true'
|
||||
traefik.frontend.rule: Host:nginx.local
|
||||
traefik.frontend.entryPoints: http,https
|
||||
traefik.frontend.redirect.entryPoint: https
|
||||
traefik.port: 80
|
||||
|
||||
volumes:
|
||||
conf:
|
|
@ -0,0 +1,26 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
|
||||
traefik:
|
||||
image: traefik:v1.7
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
command:
|
||||
- --entrypoints=Name:http Address::80
|
||||
- --entrypoints=Name:https Address::443 TLS
|
||||
- --docker
|
||||
- --docker.exposedbydefault=false
|
||||
- --logLevel=DEBUG
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
nginx:
|
||||
image: nginx:1.17.8-alpine
|
||||
labels:
|
||||
traefik.enable: 'true'
|
||||
traefik.frontend.rule: Host:nginx.local
|
||||
traefik.frontend.entryPoints: http,https
|
||||
traefik.frontend.redirect.entryPoint: https
|
||||
traefik.port: 80
|
|
@ -0,0 +1,23 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
|
||||
traefik:
|
||||
image: traefik:v1.7
|
||||
ports:
|
||||
- 80:80
|
||||
command:
|
||||
- --entrypoints=Name:http Address::80
|
||||
- --docker
|
||||
- --docker.exposedbydefault=false
|
||||
- --logLevel=DEBUG
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
nginx:
|
||||
image: nginx:1.17.8-alpine
|
||||
labels:
|
||||
traefik.enable: 'true'
|
||||
traefik.frontend.rule: Host:nginx.local
|
||||
traefik.frontend.entryPoints: http
|
||||
traefik.port: 80
|
|
@ -0,0 +1,36 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
|
||||
traefik:
|
||||
image: traefik:v1.7
|
||||
ports:
|
||||
- 80:80
|
||||
command:
|
||||
- --entrypoints=Name:http Address::80
|
||||
- --docker.swarmMode
|
||||
- --docker.network=traefik
|
||||
- --docker.exposedbydefault=false
|
||||
- --logLevel=DEBUG
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
networks:
|
||||
- traefik
|
||||
|
||||
nginx:
|
||||
image: nginx:1.17.8-alpine
|
||||
deploy:
|
||||
labels:
|
||||
traefik.enable: 'true'
|
||||
traefik.frontend.rule: Host:nginx.local
|
||||
traefik.frontend.entryPoints: http
|
||||
traefik.port: 80
|
||||
networks:
|
||||
- traefik
|
||||
|
||||
networks:
|
||||
|
||||
traefik:
|
||||
driver: overlay
|
||||
external: true
|
||||
attachable: true
|
|
@ -6,26 +6,26 @@ services:
|
|||
image: traefik:v2.1
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
command:
|
||||
- --entrypoints.http.address=:80
|
||||
- --entrypoints.https.address=:443
|
||||
- --providers.docker.exposedByDefault=false
|
||||
- --log.level=DEBUG
|
||||
- --api=true
|
||||
- --api.dashboard=true
|
||||
labels:
|
||||
traefik.enable: 'true'
|
||||
traefik.http.middlewares.traefik-dashboard-auth.basicauth.users: traefik_user:$$apr1$$epoKf5li$$QfTMJZOCS/halv3CiIUEu0
|
||||
traefik.http.middlewares.traefik-dashboard-redirect.redirectscheme.scheme: https
|
||||
traefik.http.services.traefik-dashboard-service.loadbalancer.server.port: 9999
|
||||
traefik.http.routers.traefik-dashboard-http-router.entrypoints: http
|
||||
traefik.http.routers.traefik-dashboard-http-router.rule: Host(`traefik-ui.local`)
|
||||
traefik.http.routers.traefik-dashboard-http-router.service: api@internal
|
||||
traefik.http.middlewares.traefik-dashboard-auth.basicauth.users: traefik_user:$$apr1$$epoKf5li$$QfTMJZOCS/halv3CiIUEu0
|
||||
traefik.http.routers.traefik-dashboard-http-router.middlewares: traefik-dashboard-auth
|
||||
traefik.http.routers.traefik-dashboard-http-router.middlewares: traefik-dashboard-redirect
|
||||
traefik.http.routers.traefik-dashboard-https-router.service: api@internal
|
||||
traefik.http.routers.traefik-dashboard-https-router.entrypoints: https
|
||||
traefik.http.routers.traefik-dashboard-https-router.tls: 'true'
|
||||
traefik.http.routers.traefik-dashboard-https-router.rule: Host(`traefik-ui.local`)
|
||||
traefik.http.routers.traefik-dashboard-https-router.middlewares: traefik-dashboard-auth
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
nginx:
|
||||
image: nginx:1.17.8-alpine
|
||||
labels:
|
||||
traefik.enable: 'true'
|
||||
traefik.http.routers.nginx-http-router.entrypoints: http
|
||||
traefik.http.routers.nginx-http-router.rule: Host(`nginx.local`)
|
||||
traefik.http.services.nginx-service.loadbalancer.server.port: 80
|
|
@ -0,0 +1,33 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
|
||||
traefik:
|
||||
image: traefik:v2.1
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
command:
|
||||
- --entrypoints.http.address=:80
|
||||
- --entrypoints.https.address=:443
|
||||
- --providers.docker.exposedByDefault=false
|
||||
- --log.level=DEBUG
|
||||
- --certificatesResolvers.letsencrypt_resolver.acme.email=you@mail.com
|
||||
- --certificatesResolvers.letsencrypt_resolver.acme.storage=/etc/traefik/acme.json
|
||||
- --certificatesResolvers.letsencrypt_resolver.acme.httpChallenge.entryPoint=http
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
nginx:
|
||||
image: nginx:1.17.8-alpine
|
||||
labels:
|
||||
traefik.enable: 'true'
|
||||
traefik.http.services.nginx-service.loadbalancer.server.port: 80
|
||||
traefik.http.middlewares.nginx-redirect.redirectscheme.scheme: https
|
||||
traefik.http.routers.nginx-http-router.entrypoints: http
|
||||
traefik.http.routers.nginx-http-router.rule: Host(`nginx.local`)
|
||||
traefik.http.routers.nginx-http-router.middlewares: nginx-redirect
|
||||
traefik.http.routers.nginx-https-router.entrypoints: https
|
||||
traefik.http.routers.nginx-https-router.tls: 'true'
|
||||
traefik.http.routers.nginx-https-router.rule: Host(`nginx.local`)
|
||||
traefik.http.routers.nginx-https-router.tls.certresolver: letsencrypt_resolver
|
|
@ -0,0 +1,29 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
|
||||
traefik:
|
||||
image: traefik:v2.1
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
command:
|
||||
- --entrypoints.http.address=:80
|
||||
- --entrypoints.https.address=:443
|
||||
- --providers.docker.exposedByDefault=false
|
||||
- --log.level=DEBUG
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
nginx:
|
||||
image: nginx:1.17.8-alpine
|
||||
labels:
|
||||
traefik.enable: 'true'
|
||||
traefik.http.services.nginx-service.loadbalancer.server.port: 80
|
||||
traefik.http.middlewares.nginx-redirect.redirectscheme.scheme: https
|
||||
traefik.http.routers.nginx-http-router.entrypoints: http
|
||||
traefik.http.routers.nginx-http-router.rule: Host(`nginx.local`)
|
||||
traefik.http.routers.nginx-http-router.middlewares: nginx-redirect
|
||||
traefik.http.routers.nginx-https-router.entrypoints: https
|
||||
traefik.http.routers.nginx-https-router.tls: 'true'
|
||||
traefik.http.routers.nginx-https-router.rule: Host(`nginx.local`)
|
|
@ -0,0 +1,22 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
|
||||
traefik:
|
||||
image: traefik:v2.1
|
||||
ports:
|
||||
- 80:80
|
||||
command:
|
||||
- --entrypoints.http.address=:80
|
||||
- --providers.docker.exposedByDefault=false
|
||||
- --log.level=DEBUG
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
nginx:
|
||||
image: nginx:1.17.8-alpine
|
||||
labels:
|
||||
traefik.enable: 'true'
|
||||
traefik.http.routers.nginx-http-router.entrypoints: http
|
||||
traefik.http.routers.nginx-http-router.rule: Host(`nginx.local`)
|
||||
traefik.http.services.nginx-service.loadbalancer.server.port: 80
|
|
@ -0,0 +1,36 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
|
||||
traefik:
|
||||
image: traefik:v2.1
|
||||
ports:
|
||||
- 80:80
|
||||
command:
|
||||
- --entrypoints.http.address=:80
|
||||
- --providers.docker.exposedByDefault=false
|
||||
- --log.level=DEBUG
|
||||
- --providers.docker.swarmMode=true
|
||||
- --providers.docker.network=traefik
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
networks:
|
||||
- traefik
|
||||
|
||||
nginx:
|
||||
image: nginx:1.17.8-alpine
|
||||
labels:
|
||||
traefik.enable: 'true'
|
||||
traefik.http.routers.nginx-http-router.entrypoints: http
|
||||
traefik.http.routers.nginx-http-router.rule: Host(`nginx.local`)
|
||||
traefik.http.services.nginx-service.loadbalancer.server.port: 80
|
||||
networks:
|
||||
- traefik
|
||||
|
||||
networks:
|
||||
|
||||
traefik:
|
||||
driver: overlay
|
||||
external: true
|
||||
attachable: true
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
|
||||
traefik:
|
||||
image: traefik:v2.1
|
||||
ports:
|
||||
- 80:80
|
||||
command:
|
||||
- --entrypoints.http.address=:80
|
||||
- --providers.docker.exposedByDefault=false
|
||||
- --log.level=DEBUG
|
||||
- --providers.docker.swarmMode=true
|
||||
- --providers.docker.network=traefik
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
networks:
|
||||
- traefik
|
||||
|
||||
nginx:
|
||||
image: nginx:1.17.8-alpine
|
||||
deploy:
|
||||
labels:
|
||||
traefik.enable: 'true'
|
||||
traefik.http.routers.nginx-http-router.entrypoints: http
|
||||
traefik.http.routers.nginx-http-router.rule: Host(`nginx.local`)
|
||||
traefik.http.services.nginx-service.loadbalancer.server.port: 80
|
||||
networks:
|
||||
- traefik
|
||||
|
||||
networks:
|
||||
|
||||
traefik:
|
||||
driver: overlay
|
||||
external: true
|
||||
attachable: true
|
||||
|
Ładowanie…
Reference in New Issue