traefik.mydomain.com
stack: docker swarm
Мой docker-compose.yml
version: "3.3"
services:
proxy:
image: traefik:v2.2
ports:
- "80:80"
- "8080:8080"
networks:
- ${TRAEFIK_PUBLIC_NETWORK?Variable not set}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command:
- --providers.docker
- --providers.docker.constraints=Label(`traefik.constraint-label-stack`, `${TRAEFIK_TAG?Variable not set}`)
- --providers.docker.exposedbydefault=true
- --providers.docker.swarmmode
- --accesslog
- --log
- --api
- --api.insecure=true
labels:
- traefik.enable=true
- traefik.http.routers.teamslot_proxy_1.rule=Host(`traefik.mydomain.com`)
- traefik.frontend.rule=Host(`traefik.mydomain.com`)
- traefik.port=8080
- traefik.http.services.${STACK_NAME?Variable not set}-traefik-public.loadbalancer.server.port=80
deploy:
placement:
constraints:
- node.role == manager
labels:
- traefik.enable=true
- traefik.docker.network=$${TRAEFIK_PUBLIC_NETWORK?Variable not set}
- traefik.constraint-label=$${TRAEFIK_PUBLIC_TAG?Variable not set}
- traefik.http.middlewares.$${STACK_NAME?Variable not set}-https-redirect.redirectscheme.scheme=https
- traefik.http.middlewares.$${STACK_NAME?Variable not set}-https-redirect.redirectscheme.permanent=true
- traefik.http.routers.$${STACK_NAME?Variable not set}-proxy-http.rule=Host(`$${DOMAIN?Variable not set}`) || Host(`www.$${DOMAIN?Variable not set}`)
- traefik.http.routers.$${STACK_NAME?Variable not set}-proxy-http.entrypoints=http
- traefik.http.routers.$${STACK_NAME?Variable not set}-proxy-https.rule=Host(`$${DOMAIN?Variable not set}`) || Host(`www.$${DOMAIN?Variable not set}`)
- traefik.http.routers.$${STACK_NAME?Variable not set}-proxy-https.entrypoints=https
- traefik.http.routers.$${STACK_NAME?Variable not set}-proxy-https.tls=true
- traefik.http.routers.$${STACK_NAME?Variable not set}-proxy-https.tls.certresolver=le
- traefik.http.services.$${STACK_NAME?Variable not set}-proxy.loadbalancer.server.port=80
- traefik.http.middlewares.$${STACK_NAME?Variable not set}-www-redirect.redirectregex.regex=^https?://(www.)?($${DOMAIN?Variable not set})/(.*)
- traefik.http.middlewares.$${STACK_NAME?Variable not set}-www-redirect.redirectregex.replacement=https://$${DOMAIN?Variable not set}/$$$${3}
- traefik.http.routers.$${STACK_NAME?Variable not set}-proxy-https.middlewares=$${STACK_NAME?Variable not set}-www-redirect
- traefik.http.routers.$${STACK_NAME?Variable not set}-proxy-http.middlewares=$${STACK_NAME?Variable not set}-www-redirect,$${STACK_NAME?Variable not set}-https-redirect
volumes:
app-db-data:
networks:
traefik-public:
external: ${TRAEFIK_PUBLIC_NETWORK_IS_EXTERNAL-true}
О боже, что это?
Что мущает?
Обсуждают сегодня