| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- ---
- name: "Grafana Alloy"
- description: "A lightweight and flexible service mesh"
- version: "0.0.1"
- date: "2023-10-01"
- author: "Christian Lempa"
- tags:
- - "grafana"
- - "alloy"
- - "monitoring"
- - "http"
- - "traefik"
- ---
- {% variables %}
- container_hostname:
- description: "Sets the container's internal hostname (this will show up in the collected logs)"
- {% endvariables %}
- services:
- {{ service_name | default("alloy")}}:
- image: grafana/alloy:v1.10.2
- container_name: {{ container_name | default("alloy") }}
- hostname: {{ container_hostname }}
- command:
- - run
- - --server.http.listen-addr=0.0.0.0:12345
- - --storage.path=/var/lib/alloy/data
- - /etc/alloy/config.alloy
- ports:
- - "12345:12345"
- volumes:
- - ./config.alloy:/etc/alloy/config.alloy
- - alloy_data:/var/lib/alloy/data
- - /:/rootfs:ro
- - /run:/run:ro
- - /var/log:/var/log:ro
- - /sys:/sys:ro
- - /var/lib/docker/:/var/lib/docker/:ro
- - /run/udev/data:/run/udev/data:ro
- networks:
- - {{ docker_network | default("bridge")}}
- {% if traefik %}
- labels:
- - traefik.enable={{ traefik_enable | default(true) }}
- - traefik.http.services.{{ service_name }}.loadbalancer.server.port=12345
- - traefik.http.services.{{ service_name }}.loadbalancer.server.scheme=http
- - traefik.http.routers.{{ service_name }}.service={{ service_name }}
- - traefik.http.routers.{{ service_name }}.rule=Host(`{{ traefik_host }}`)
- {% if traefik_tls %}
- - traefik.http.routers.{{ service_name }}.tls={{ traefik_tls | default(true) }}
- - traefik.http.routers.{{ service_name }}.entrypoints={{ traefik_entrypoint | default("websecure") }}
- - traefik.http.routers.{{ service_name }}.tls.certresolver={{ traefik_certresolver | default("cloudflare") }}
- {% else %}
- - traefik.http.routers.{{ service_name }}.entrypoints={{ traefik_entrypoint | default("websecure") }}
- {% endif %}
- {% endif %}
- restart: {{ restart_policy | default("unless-stopped") }}
- volumes:
- alloy_data:
- driver: local
- networks:
- {{ docker_network | default("bridge")}}:
- external: true
|