Skip to content

Commit

Permalink
Merge da6ec66 into e17b744
Browse files Browse the repository at this point in the history
  • Loading branch information
jeluard committed Apr 29, 2024
2 parents e17b744 + da6ec66 commit ff76092
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 28 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
20 changes: 11 additions & 9 deletions docker/docker-compose.local_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,28 @@ 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: grafana_dev
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
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 ff76092

Please sign in to comment.