From da6ec66d3942fa1fc11ccfa0ea0964f8604e9054 Mon Sep 17 00:00:00 2001 From: Julien Eluard Date: Mon, 29 Apr 2024 22:33:12 +0200 Subject: [PATCH] chore: address comments --- docker/docker-compose.local.yml | 20 +++++++++++--------- docker/docker-compose.local_dev.yml | 8 +++++--- docker/grafana/Dockerfile | 3 +-- docker/grafana_dev/Dockerfile | 3 +-- docker/prometheus/Dockerfile | 8 ++------ 5 files changed, 20 insertions(+), 22 deletions(-) diff --git a/docker/docker-compose.local.yml b/docker/docker-compose.local.yml index bd0b225a624d..37d8df104aae 100644 --- a/docker/docker-compose.local.yml +++ b/docker/docker-compose.local.yml @@ -7,28 +7,30 @@ services: build: context: prometheus environment: - # Linux: http://localhost:8008 - # MacOSX: http://host.docker.internal:8008 - BEACON_URL: localhost:8008 - VC_URL: localhost:5064 + BEACON_URL: host.docker.internal:8008 + VC_URL: host.docker.internal:5064 restart: always - network_mode: host volumes: - "prometheus:/prometheus" + extra_hosts: + - "host.docker.internal:host-gateway" + ports: + - "127.0.0.1:9090:9090" grafana: build: context: .. dockerfile: docker/grafana restart: always - network_mode: host volumes: - "grafana:/var/lib/grafana" - "grafana-dashboards:/dashboards" environment: - # Linux: http://localhost:9090 - # MacOSX: http://host.docker.internal:9090 - PROMETHEUS_URL: http://localhost:9090 + PROMETHEUS_URL: http://host.docker.internal:9090 + extra_hosts: + - "host.docker.internal:host-gateway" + ports: + - "3000:3000" volumes: prometheus: diff --git a/docker/docker-compose.local_dev.yml b/docker/docker-compose.local_dev.yml index 0b257d2f5971..55c87a6b5406 100644 --- a/docker/docker-compose.local_dev.yml +++ b/docker/docker-compose.local_dev.yml @@ -1,3 +1,5 @@ +version: "3.4" + # Configuration to work with a local non-dockerized Lodestar node # For local testing and quick debugging # @@ -10,15 +12,15 @@ services: build: context: prometheus environment: - BEACON_URL: http://host.docker.internal:8008 - VC_URL: http://host.docker.internal:5064 + BEACON_URL: host.docker.internal:8008 + VC_URL: host.docker.internal:5064 restart: always volumes: - "prometheus:/prometheus" extra_hosts: - "host.docker.internal:host-gateway" ports: - - "9090:9090" + - "127.0.0.1:9090:9090" grafana: build: grafana_dev diff --git a/docker/grafana/Dockerfile b/docker/grafana/Dockerfile index 91f000f0720a..daf1a2616c2b 100644 --- a/docker/grafana/Dockerfile +++ b/docker/grafana/Dockerfile @@ -14,8 +14,7 @@ VOLUME /dashboards ENV GF_SECURITY_ADMIN_USER=admin ENV GF_SECURITY_ADMIN_PASSWORD=admin -# Modified datasource to work with a network_mode: host -ENV PROMETHEUS_URL=http://prometheus:9090 +ENV PROMETHEUS_URL=host.docker.internal:9090 ENV DASHBOARDS_DIR=/dashboards CMD [ \ diff --git a/docker/grafana_dev/Dockerfile b/docker/grafana_dev/Dockerfile index fe22ca3f0855..8404eb00a89b 100644 --- a/docker/grafana_dev/Dockerfile +++ b/docker/grafana_dev/Dockerfile @@ -13,8 +13,7 @@ COPY dashboards /dashboards/ ENV GF_SECURITY_ADMIN_USER=admin ENV GF_SECURITY_ADMIN_PASSWORD=admin -# Modified datasource to work with a network_mode: host -ENV PROMETHEUS_URL=http://prometheus:9090 +ENV PROMETHEUS_URL=host.docker.internal:9090 ENV DASHBOARDS_DIR=/dashboards CMD [ \ diff --git a/docker/prometheus/Dockerfile b/docker/prometheus/Dockerfile index 6d56840722cb..6eb82cdeff02 100644 --- a/docker/prometheus/Dockerfile +++ b/docker/prometheus/Dockerfile @@ -4,12 +4,8 @@ COPY prometheus.yml /etc/prometheus/prometheus.yml COPY --chown=nobody:nobody entrypoint.sh /etc/prometheus/entrypoint.sh RUN chmod +x /etc/prometheus/entrypoint.sh -# Modified datasource to work with a network_mode: host -# Docker DNS: "beacon_node:8008" -# net host: "localhost:8008" -# MacOSX: "host.docker.internal:8008" -ENV BEACON_URL='beacon_node:8008' -ENV VC_URL='validator:5064' +ENV BEACON_URL='host.docker.internal:8008' +ENV VC_URL='host.docker.internal:5064' VOLUME /prometheus ENTRYPOINT ["/etc/prometheus/entrypoint.sh"]