Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
# simple proxy example using traefik single container
# for a more full-featured solution with multi-node proxy,
# HA, consul backend, and more, see stack-proxy-global.yml
version: '3.7'
x-default-opts:
&default-opts
logging:
options:
max-size: "1m"
# driver: "gelf"
# options:
# gelf-address: "udp://127.0.0.1:5000"
services:
traefik:
<<: *default-opts
image: traefik:2.2
networks:
- proxy
volumes:
- acme:/etc/traefik/acme
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "80:80"
- "443:443"
command:
# Use your favourite settings here, but add:
- --providers.docker
- --providers.docker.swarmMode
- --providers.docker.network=proxy
- --providers.docker.watch
- --api
- --entryPoints.web.address=:80
- --entryPoints.websecure.address=:443
- --entrypoints.websecure.http.tls=true
# - --entrypoints.web.http.redirections.entryPoint.to=websecure # force HTTPS
# - --entrypoints.websecure.http.tls.certresolver=default
## optional LetsEncrypt settings
# - --certificatesResolvers.default.acme.email=${TRAEFIK_ACME_EMAIL}
# - --certificatesResolvers.default.acme.storage=/etc/traefik/acme/acme.json
# - --certificatesResolvers.default.acme.tlsChallenge=true
# - --certificatesResolvers.default.acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory
# - --certificatesResolvers.default.acme.caServer=https://acme-v02.api.letsencrypt.org/directory
deploy:
placement:
constraints: [node.role == manager]
# Dynamic Configuration
labels:
traefik.http.routers.api.rule: Host(`traefik.dogvs.cat`)
traefik.http.routers.api.entryPoints: websecure
traefik.http.routers.api.service: api@internal
traefik.http.routers.api.middlewares: auth
traefik.http.services.dummy.loadbalancer.server.port: 4242
# sample users/password test/test and test2/test2
traefik.http.middlewares.auth.basicauth.users: test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0
volumes:
acme:
driver: rexray/dobs
driver_opts:
size: 1
networks:
proxy:
driver: overlay
name: proxy