services:
  loki:
    extends:
      file: ${TEMPLATES_PATH}
      service: default
    container_name: loki
    image: grafana/loki:3.7.1
    ports:
      - 8094:3100
    networks:
      - ip4net
    volumes:
      - ${MONITORING_PATH}/loki/config/loki-config.yml:/etc/loki/local-config.yaml
    labels:
      # Traefik
      - "traefik.enable=true"
      - "traefik.http.routers.loki.rule=Host(`loki.${LOCAL_DOMAIN}`)"
      - "traefik.http.routers.loki.entrypoints=https"
      - "traefik.http.routers.loki.tls=true"

  promtail:
    extends:
      file: ${TEMPLATES_PATH}
      service: default
    container_name: promtail
    image: grafana/promtail:3.6.8
    networks:
      - ip4net
    volumes:
      - ${MONITORING_PATH}/loki/config/promtail-config.yml:/etc/promtail/config.yml
      - /var/log:/var/log
      - /var/run/docker.sock:/var/run/docker.sock:ro
