version: '3.8' volumes: prometheus_data: {} grafana_data: {} services: prometheus: image: prom/prometheus restart: always volumes: - ./prometheus:/etc/prometheus/ - prometheus_data:/prometheus command: - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.path=/prometheus' - '--web.console.libraries=/usr/share/prometheus/console_libraries' - '--web.console.templates=/usr/share/prometheus/consoles' ports: - 9091:9090 extra_hosts: host.docker.internal: host-gateway grafana: image: grafana/grafana user: '472' restart: always volumes: - grafana_data:/var/lib/grafana - ./grafana/provisioning/:/etc/grafana/provisioning/ env_file: - ./grafana/config.monitoring ports: - 3001:3000 depends_on: - prometheus