# Create network first # docker network create --driver=bridge --attachable --internal=false traefik #NOTES: #1. certificatesresolvers.myresolver.acme.email=myemail@gmail.com # cat docker-compose.yml version: '3.3' volumes: letsencrypt: driver: local services: traefik: image: traefik:v2.2 container_name: traefik restart: always command: - "--log.level=DEBUG" - "--api.insecure=true" - "--providers.docker=true" - "--providers.docker.network=traefik" - "--providers.docker.exposedbydefault=true" - "--entrypoints.web.address=:80" - "--entrypoints.websecure.address=:443" - "--entrypoints.web.http.redirections.entryPoint.to=websecure" - "--entrypoints.web.http.redirections.entryPoint.scheme=https" - "--certificatesresolvers.myresolver.acme.httpchallenge=true" - "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web" - "--certificatesresolvers.myresolver.acme.email=myemail@gmail.com" - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json" ports: - 80:80 - 443:443 networks: - default volumes: - /var/run/docker.sock:/var/run/docker.sock - letsencrypt:/letsencrypt networks: default: external: name: traefik