Ansible-roles/monitoring.prometheus.prepare/templates/docker-compose.yml.j2

29 lines
826 B
Django/Jinja

version: "3.7"
services:
prometheus:
container_name: prometheus
image: "{{ prometheus__image }}"
networks:
- "{{ docker__prometheus_network }}"
volumes:
- "{{ docker_deployment__deploy_path }}/alert-rules:/etc/prometheus/alert-rules:ro"
- "{{ docker_deployment__deploy_path }}/prometheus.yml:/etc/prometheus/prometheus.yml:ro"
restart: unless-stopped
ports:
- "{{ prometheus__port }}:9090"
{% if prometheus is defined and prometheus.docker is defined %}
extra_hosts: {{ prometheus.docker.extra_hosts | default([]) | to_json }}
{% endif %}
logging:
driver: "json-file"
options:
max-file: "1"
max-size: "50m"
command:
- --config.file=/etc/prometheus/prometheus.yml
networks:
{{ docker__prometheus_network }}:
external: true