version: '3'
services:
reverse-proxy:
image: lzxinux/traefik-ssh
command:
- "--api.insecure=true"
- "--providers.docker.endpoint=unix:///var/run/docker.sock"
- "--providers.swarm.endpoint=ssh://traefik@10.81.3.21"
- "--providers.swarm.network=test-net"
ports:
- "80:80"
- "8888:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./ssh/:/root/.ssh
- ./auth/:/auth/users.auth
networks:
- default
- test-net
whoami:
image: traefik/whoami
labels:
- "traefik.http.routers.whoami.rule=Host(`whoami.docker.traefik`)"
- "traefik.http.routers.whoami.rule=Path(`/`)"
networks:
test-net:
driver: overlay
external: true
version: "3.7"
services:
my_web:
image: ubuntu/apache2
networks:
- test-net
deploy:
replicas: 2
labels:
- "traefik.http.services.my_web.loadbalancer.server.port=80"
- "traefik.http.routers.my_web.rule=Host(`apache.ubuntu`) || PathPrefix(`/apache`)"
- "traefik.http.middlewares.test-path.replacepathregex.regex=^/apache(.*)"
- "traefik.http.middlewares.test-path.replacepathregex.replacement=/$$1"
- "traefik.http.routers.my_web.middlewares=test-path"
volumes:
- ./html/:/var/www/html/
networks:
test-net:
driver: overlay
external: true