Skip to content

Commit

Permalink
chore: add docker-build target and enable usage of .env in makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
gacevicljubisa committed Nov 5, 2024
1 parent 13d2a0a commit 73901ba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ _testmain.go
*.prof

.DS_Store
.env
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ COPY go.mod go.sum ./
RUN go mod download
COPY . ./

ARG REACHABILITY_OVERRIDE_PUBLIC=false

RUN make binary REACHABILITY_OVERRIDE_PUBLIC=${REACHABILITY_OVERRIDE_PUBLIC}
RUN make binary

FROM debian:12.4-slim

Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
ifneq (,$(wildcard ./.env))
include .env
export
endif

GO ?= go
GOBIN ?= $$($(GO) env GOPATH)/bin
GOLANGCI_LINT ?= $(GOBIN)/golangci-lint
Expand All @@ -11,6 +16,7 @@ BEELOCAL_BRANCH ?= main
BEEKEEPER_BRANCH ?= master
REACHABILITY_OVERRIDE_PUBLIC ?= false
BATCHFACTOR_OVERRIDE_PUBLIC ?= 5
IMAGE ?= ethersphere/bee:latest

BEE_API_VERSION ?= "$(shell grep '^ version:' openapi/Swarm.yaml | awk '{print $$2}')"

Expand Down Expand Up @@ -141,6 +147,10 @@ build: export CGO_ENABLED=0
build:
$(GO) build -trimpath -ldflags "$(LDFLAGS)" ./...

.PHONY: docker-build
docker-build:
docker build -t $(IMAGE) . --no-cache

.PHONY: githooks
githooks:
ln -f -s ../../.githooks/pre-push.bash .git/hooks/pre-push
Expand Down

0 comments on commit 73901ba

Please sign in to comment.