summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-04-14 17:20:42 -0600
committermo khan <mo@mokhan.ca>2025-04-14 17:20:42 -0600
commit21acf441fbcbb663a7b600733e8daed7a3daf8e7 (patch)
tree71b6fa502ab4d6f692aba1f7d3190de0e225dd8b /Makefile
parent81c1c773521fa345d506ad72a4665f38b1df4e6e (diff)
chore: load env vars from .env files
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 8 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 8a66869..1b615fa 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,8 @@ clean:
setup:
@mise install
+ @go install tool
+ @command -v godotenv
build: sparkled
@@ -31,10 +33,14 @@ build-builder-image:
@docker build --target build --tag $(IMAGE_TAG) .
run: clean build
- BIND_ADDR=:8080 ./sparkled
+ @godotenv -f .env.local,.env ./sparkled
run-image: build-image
- @docker run -p 8080:80 -it $(IMAGE_TAG)
+ @if [ -f ".env.local" ]; then \
+ docker run --env BIND_ADDR=:http --env-file .env.local -p 8080:80 -it $(IMAGE_TAG); \
+ else \
+ docker run --env BIND_ADDR=:http --env-file .env -p 8080:80 -it $(IMAGE_TAG); \
+ fi
sh-image: build-builder-image
@docker run -it $(IMAGE_TAG) /bin/sh