version: '3.8' services: prometheus: image: prom/prometheus:latest container_name: prometheus ports: - "9090:9090" 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' restart: unless-stopped extra_hosts: - "host.docker.internal:host-gateway" grafana: image: grafana/grafana:latest container_name: grafana ports: - "3000:3000" volumes: - ./grafana/provisioning:/etc/grafana/provisioning - grafana_data:/var/lib/grafana environment: - GF_SECURITY_ADMIN_USER=admin - GF_SECURITY_ADMIN_PASSWORD=admin - GF_USERS_ALLOW_SIGN_UP=false restart: unless-stopped depends_on: - prometheus volumes: prometheus_data: grafana_data: