version: "3" services: traefik: image: traefik:latest container_name: traefik restart: unless-stopped security_opt: - no-new-privileges:true networks: - proxy - inbound ports: - 80:80 - 443:443 - target: 8080 published: 8080 protocol: tcp mode: ingress volumes: - /etc/localtime:/etc/localtime:ro - /var/run/docker.sock:/var/run/docker.sock:ro - ./traefik-data/traefik.yml:/traefik.yml:ro - ./traefik-data/acme.json:/acme.json - ./traefik-data/configurations:/configurations labels: - "traefik.enable=true" - "traefik.docker.network=proxy" - "traefik.http.routers.traefik-secure.entrypoints=websecure" - "traefik.http.routers.traefik-secure.rule=Host(`traefik.DOMINIO`)" - "traefik.http.routers.traefik-secure.middlewares=user-auth@file" - "traefik.http.routers.traefik-secure.service=api@internal" command: - "--log.level=DEBUG" - "--api.insecure=true" - "--metrics.prometheus=true" - "--metrics.prometheus.buckets=0.1,0.3,1.2,5.0" - "--providers.docker=true" - "--providers.docker.swarmmode=true" - "--providers.docker.watch" portainer: image: portainer/portainer-ce:latest container_name: portainer restart: unless-stopped security_opt: - no-new-privileges:true networks: - proxy volumes: - /etc/localtime:/etc/localtime:ro - /var/run/docker.sock:/var/run/docker.sock:ro - ./portainer-data:/data labels: - "traefik.enable=true" - "traefik.docker.network=proxy" - "traefik.http.routers.portainer-secure.entrypoints=websecure" - "traefik.http.routers.portainer-secure.rule=Host(`portainer.DOMINIO`)" - "traefik.http.routers.portainer-secure.service=portainer" - "traefik.http.services.portainer.loadbalancer.server.port=9000" networks: proxy: external: true inbound: