From 8f6ad173ecace56aa7ed65502f8ceb7d125173a6 Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 30 Nov 2023 00:37:00 +0100 Subject: [PATCH] update makefile --- Dockerfile-stub | 10 ++++++++++ Makefile | 25 +++---------------------- cmd/{explorer => dora-explorer}/main.go | 0 3 files changed, 13 insertions(+), 22 deletions(-) create mode 100644 Dockerfile-stub rename cmd/{explorer => dora-explorer}/main.go (100%) diff --git a/Dockerfile-stub b/Dockerfile-stub new file mode 100644 index 00000000..81041d34 --- /dev/null +++ b/Dockerfile-stub @@ -0,0 +1,10 @@ + +# final stage +FROM debian:stable-slim +WORKDIR /app +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates +RUN update-ca-certificates +COPY bin/* /app +EXPOSE 8080 +ENTRYPOINT ["./dora-explorer"] +CMD [] \ No newline at end of file diff --git a/Makefile b/Makefile index 4bf09519..c21d4628 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,4 @@ # dora -EXECUTABLE=explorer -WINDOWS=$(EXECUTABLE)_windows_amd64.exe -LINUX=$(EXECUTABLE)_linux_amd64 -DARWIN=$(EXECUTABLE)_darwin_amd64 -VERSION := $(shell git rev-parse --short HEAD) BUILDTIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ') VERSION := $(shell git rev-parse --short HEAD) @@ -18,23 +13,9 @@ all: test build test: go test ./... -build: windows linux darwin +build: @echo version: $(VERSION) - -windows: $(WINDOWS) - -linux: $(LINUX) - -darwin: $(DARWIN) - -$(WINDOWS): - env CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -v -o bin/$(WINDOWS) -ldflags="-s -w $(GOLDFLAGS)" ./cmd/explorer - -$(LINUX): - env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -v -o bin/$(LINUX) -ldflags="-s -w $(GOLDFLAGS)" ./cmd/explorer - -$(DARWIN): - env CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -v -o bin/$(DARWIN) -ldflags="-s -w $(GOLDFLAGS)" ./cmd/explorer + env CGO_ENABLED=1 go build -v -o bin/ -ldflags="-s -w $(GOLDFLAGS)" ./cmd/* clean: - rm -f $(WINDOWS) $(LINUX) $(DARWIN) + rm -f bin/* diff --git a/cmd/explorer/main.go b/cmd/dora-explorer/main.go similarity index 100% rename from cmd/explorer/main.go rename to cmd/dora-explorer/main.go