networks:
  traefik:
    external: true

volumes:
  portainer_data:

services:
  portainer:
    image: portainer/portainer-ce 
    container_name: portainer
    restart: unless-stopped
    networks:
      - traefik
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - portainer_data:/data
    labels:
      - traefik.http.routers.portainer.rule=Host(`admin.whitney.rip`)
      - traefik.http.routers.portainer.tls=true
      - traefik.http.routers.portainer.tls.certresolver=lets-encrypt
      - traefik.http.services.portainer.loadbalancer.server.port=9000
        
