Skip to content

Commit

Permalink
chore: address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jeluard committed Apr 29, 2024
1 parent cdd29e5 commit da6ec66
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 22 deletions.
20 changes: 11 additions & 9 deletions docker/docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 5 additions & 3 deletions docker/docker-compose.local_dev.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: "3.4"

# Configuration to work with a local non-dockerized Lodestar node
# For local testing and quick debugging
#
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions docker/grafana/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 [ \
Expand Down
3 changes: 1 addition & 2 deletions docker/grafana_dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 [ \
Expand Down
8 changes: 2 additions & 6 deletions docker/prometheus/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit da6ec66

Please sign in to comment.