From 62bc4c2ad326b333be6060a357a8a4926348fb35 Mon Sep 17 00:00:00 2001 From: Tyrel Narciso Date: Thu, 8 Feb 2024 14:01:00 -0800 Subject: [PATCH] DBC22-1712: added makefile and conditional m1 image --- Makefile | 20 ++++++++++++++++++++ docker-compose.m1.yml | 5 +++++ 2 files changed, 25 insertions(+) create mode 100644 Makefile create mode 100644 docker-compose.m1.yml diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..21b357dc --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +SHELL := /bin/bash +.PHONY: help down +ARCH := $(shell uname -m) + +help: ## This help. + @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) + +.DEFAULT_GOAL := help + +up: ## Bring up containers + @echo 'Starting containers...' + @if [ "$(ARCH)" = "arm64" ]; then \ + docker-compose -f docker-compose.yml -f docker-compose.m1.yml up -d; \ + else \ + docker-compose up -d; \ + fi + +down: ## Stop and remove containers and volumes + @echo 'Removing containers and volumes...' + docker-compose down -v diff --git a/docker-compose.m1.yml b/docker-compose.m1.yml new file mode 100644 index 00000000..88f74e2e --- /dev/null +++ b/docker-compose.m1.yml @@ -0,0 +1,5 @@ +services: + db: + image: tobi312/rpi-postgresql-postgis:15-3.4-alpine-arm + django: + platform: linux/amd64