From 034b51559b5cf4787dacf3873c6936f6b9054f86 Mon Sep 17 00:00:00 2001 From: mrjones-plip Date: Tue, 30 Apr 2024 14:32:07 -0700 Subject: [PATCH] mrjones try and hack host.docker.internal to work --- development/host.docker.internal.yml | 20 ++++++++++++++++++++ development/kill.start.ips.sh | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 development/host.docker.internal.yml diff --git a/development/host.docker.internal.yml b/development/host.docker.internal.yml new file mode 100644 index 0000000..9526497 --- /dev/null +++ b/development/host.docker.internal.yml @@ -0,0 +1,20 @@ +# file to add shared host of host.docker.internal to all instances running in dev +# thanks https://stackoverflow.com/a/70725882 +# and thanks https://nickjanetakis.com/blog/connect-to-a-service-running-on-your-docker-host-from-a-container + +services: + prometheus: + extra_hosts: + - "host.docker.internal:host-gateway" + + grafana: + extra_hosts: + - "host.docker.internal:host-gateway" + + json-exporter: + extra_hosts: + - "host.docker.internal:host-gateway" + + sql_exporter: + extra_hosts: + - "host.docker.internal:host-gateway" diff --git a/development/kill.start.ips.sh b/development/kill.start.ips.sh index 8fb9fb6..1d856f0 100755 --- a/development/kill.start.ips.sh +++ b/development/kill.start.ips.sh @@ -13,6 +13,7 @@ docker compose \ -f docker-compose.yml \ -f exporters/postgres/compose.yml \ -f development/fake-cht/docker-compose.fake-cht.yml \ + -f development/host.docker.internal.yml \ kill echo;echo "Starting...";echo @@ -20,6 +21,7 @@ docker compose \ -f docker-compose.yml \ -f exporters/postgres/compose.yml \ -f development/fake-cht/docker-compose.fake-cht.yml \ + -f development/host.docker.internal.yml \ up -d \ --remove-orphans