diff --git a/Makefile b/Makefile index 1ae11dc..baf6dba 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,19 @@ #!make -include .env +ifneq (,$(wildcard ./.env)) + include .env +endif export -build: +.DEFAULT_GOAL := help + +.PHONY: build +build: ## Get blackbox_exporter image from GitHub and build ./build.sh -run: build +.PHONY: run +run: ## Get blackbox_exporter image from GitHub, build and run against target in .env + $(MAKE) build docker run -it -e PROM_USER=$$PROM_USER -e PROM_PASS=$$PROM_PASS -e PROM_TARGET=$$PROM_TARGET -e REMOTE_WRITE_URL=$$REMOTE_WRITE_URL app-reachability:latest -.PHONY: build run \ No newline at end of file +help: + @grep -h -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/build.sh b/build.sh index 20c9788..7c10d3d 100755 --- a/build.sh +++ b/build.sh @@ -7,4 +7,4 @@ tar -xzvf tmp/bb.tar.gz -C ./tmp mkdir -p build mv ./tmp/blackbox_exporter-0.19.0.linux-amd64/blackbox_exporter ./build -docker build -t app-reachability . +docker build --platform linux/amd64 -t app-reachability . diff --git a/docker-compose.yml b/docker-compose.yml index 04787aa..313ba06 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3' +version: "3" networks: monitor-net: @@ -7,10 +7,10 @@ networks: services: reachability: image: ghcr.io/ministryofjustice/staff-infrastructure-monitoring-app-reachability:main + platform: linux/x86_64 container_name: app-reachability environment: - PROM_USER= # basic auth username for prometheus - PROM_PASS= # basic auth password for prometheus - PROM_TARGET= # full url of http endpoint for monitoring - REMOTE_WRITE_URL= # url for prometheus/thanos remote write - \ No newline at end of file