refactor: use bin instead of build directory
This commit is contained in:
parent
d2b4bdf324
commit
8c6ded6794
@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
# Artefacts
|
# Artefacts
|
||||||
/bin
|
/bin
|
||||||
/build
|
|
||||||
/data
|
/data
|
||||||
/docs
|
/docs
|
||||||
|
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
# Artefacts
|
# Artefacts
|
||||||
/bin
|
/bin
|
||||||
/build
|
|
||||||
/data
|
/data
|
||||||
|
|
||||||
# Dependency directories (remove the comment below to include it)
|
# Dependency directories (remove the comment below to include it)
|
||||||
|
|||||||
@ -21,7 +21,7 @@ RUN go mod download
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the application
|
# Build the application
|
||||||
RUN go build -gcflags="all=-N -l" -o /build/app .
|
RUN go build -gcflags="all=-N -l" -o bin/app .
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ WORKDIR /
|
|||||||
|
|
||||||
# Copy binary from build to main folder
|
# Copy binary from build to main folder
|
||||||
COPY --from=builder /go/bin/dlv .
|
COPY --from=builder /go/bin/dlv .
|
||||||
COPY --from=builder /build/app app
|
COPY --from=builder /source/bin/app app
|
||||||
|
|
||||||
# Copy some application assets
|
# Copy some application assets
|
||||||
COPY --from=builder /source/deploy/docker/environment.sh ./deploy/docker/environment.sh
|
COPY --from=builder /source/deploy/docker/environment.sh ./deploy/docker/environment.sh
|
||||||
|
|||||||
@ -18,7 +18,7 @@ RUN go mod download
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the application
|
# Build the application
|
||||||
RUN go build -ldflags "-s -w" -o /build/app .
|
RUN go build -ldflags "-s -w" -o /bin/app .
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ WORKDIR /
|
|||||||
|
|
||||||
# Copy binary from build to main folder
|
# Copy binary from build to main folder
|
||||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
COPY --from=builder /build/app app
|
COPY --from=builder /bin/app app
|
||||||
|
|
||||||
# Copy some application assets
|
# Copy some application assets
|
||||||
#COPY --from=builder /source/deploy/docker/environment.sh ./deploy/docker/environment.sh
|
#COPY --from=builder /source/deploy/docker/environment.sh ./deploy/docker/environment.sh
|
||||||
|
|||||||
2
Makefile
2
Makefile
@ -14,7 +14,7 @@ help: ## Display this help screen
|
|||||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build -ldflags "-s -w" -o build/app .
|
go build -ldflags "-s -w" -o bin/app .
|
||||||
|
|
||||||
run:
|
run:
|
||||||
make build-backoffice-gateway
|
make build-backoffice-gateway
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user