Skip to main content

Portainer

Makefile
update:
        docker-compose up -d
.env
TRAEFIK_URL_PORTAINER=portainer.clients.xelyos.fr
DOCKER_TRAEFIK_NETWORK=traefik_network
docker-compose.yaml
networks:
    traefik_network:
        name: ${DOCKER_TRAEFIK_NETWORK}
        external: true

services:
  portainer:
    image: portainer/portainer-ce:latest
    container_name: portainer
    restart: unless-stopped
    command: -H unix:///var/run/docker.sock
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock # Accès au socket Docker
      - ./data:/data                      # Volume de stockage des données
    networks:
      - traefik_network
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.portainer.rule=Host(`${TRAEFIK_URL_PORTAINER}`)"
      - "traefik.http.routers.portainer.entrypoints=websecure"
      - "traefik.http.routers.portainer.tls.certresolver=myresolver"
      - "traefik.docker.network=traefik_network"
      - "traefik.http.services.portainer.loadbalancer.server.port=9000"