Skip to content

Commit

Permalink
♻️ Handle config arg for make cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
ishantiw committed Feb 8, 2024
1 parent 747d46f commit e01cb4f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /app

# Build binary
COPY . .
RUN make build-app
RUN make build

# Use alpine to run app
FROM alpine
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ build:
@echo "$(GREEN) Binary successfully built$(COLOR_END)"

run-app:
ifdef config
@./bin/${APP_NAME} --config $(config)
else
@./bin/${APP_NAME}
endif

test:
@echo "Test packages"
Expand Down Expand Up @@ -46,5 +50,10 @@ docker-build:

.PHONY: docker-run
docker-run:
ifdef config
@echo "$(BLUE) Running docker image...$(COLOR_END)"
@docker run -p 8080:8080 $(APP_NAME)
@docker run -p 8080:8080 -v $(config):/home/onchain/faultdetector/config.yaml -t $(APP_NAME)
else
@echo "$(BLUE) Running docker image...$(COLOR_END)"
@docker run -p 8080:8080 $(APP_NAME)
endif

0 comments on commit e01cb4f

Please sign in to comment.