version: "3"

networks:
  traefik_traefik-network:
    external: true
volumes:
  portainer_data:

services:
  portainer:
    image: portainer/portainer-ce 
    container_name: portainer
    restart: always
    networks:
      - traefik_traefik-network
    ports:
      - "[[HOST_URL]]:9000"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - portainer_data:/data
    labels:
      - traefik.http.routers.portainer.rule=Host(`[[SITE_URL]]`)
      - traefik.http.routers.portainer.tls=true
      - traefik.http.routers.portainer.tls.certresolver=lets-encrypt
      - traefik.http.services.portainer.loadbalancer.server.port=9000
      - traefik.port=[[HOST_URL]]
        
