name: trigger

services:
  webapp:
    networks:
      - traefik
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.webapp.rule=Host(`webapp.localhost`)"
      - "traefik.http.routers.webapp.entrypoints=${TRAEFIK_ENTRYPOINT:-web}"
      # - "traefik.http.routers.webapp.tls.certresolver=letsencrypt"
      - "traefik.http.services.webapp.loadbalancer.server.port=3000"

  registry:
    networks:
      - traefik
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.registry.rule=Host(`registry.localhost`)"
      - "traefik.http.routers.registry.entrypoints=${TRAEFIK_ENTRYPOINT:-web}"
      # - "traefik.http.routers.registry.tls.certresolver=letsencrypt"
      - "traefik.http.services.registry.loadbalancer.server.port=5000"

  minio:
    networks:
      - traefik
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.minio.rule=Host(`minio.localhost`)"
      - "traefik.http.routers.minio.entrypoints=${TRAEFIK_ENTRYPOINT:-web}"
      # - "traefik.http.routers.minio.tls.certresolver=letsencrypt"
      - "traefik.http.services.minio.loadbalancer.server.port=9000"

  traefik:
    image: traefik:${TRAEFIK_IMAGE_TAG:-v3.4}
    restart: ${RESTART_POLICY:-unless-stopped}
    ports:
      - "${TRAEFIK_HTTP_PUBLISH_IP:-0.0.0.0}:80:80"
      - "${TRAEFIK_HTTPS_PUBLISH_IP:-0.0.0.0}:443:443"
      - "${TRAEFIK_DASHBOARD_PUBLISH_IP:-127.0.0.1}:8080:8080" # dashboard
    networks:
      - traefik
    command:
      - --api.insecure=true
      - --providers.docker=true
      - --providers.docker.exposedbydefault=false
      - --providers.docker.network=traefik
      - --entrypoints.web.address=:80
      - --entrypoints.websecure.address=:443
      # - --certificatesresolvers.letsencrypt.acme.tlschallenge=true
      # - --certificatesresolvers.letsencrypt.acme.email=local@example.com
      # - --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json
      - --log.level=DEBUG
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - traefik-letsencrypt:/letsencrypt

volumes:
  minio:
  traefik-letsencrypt:

networks:
  traefik:
    name: traefik
