1
4
mirror of https://github.com/yunginnanet/HellPot synced 2024-06-24 23:08:03 +00:00
HellPot/Dockerfile
Antonio Gurgel 6ea9d4753f Dockerize
2023-08-12 22:26:13 -07:00

25 lines
502 B
Docker

FROM golang:1.20 as build
WORKDIR /go/src/app
COPY go.* .
RUN go mod download
COPY . .
RUN go vet -v ./...
RUN go test -v ./...
RUN \
CGO_ENABLED=0 \
VERSION=`git tag --sort=-version:refname | head -n 1` \
go build -trimpath \
-ldflags "-s -w -X main.version=$VERSION" \
cmd/HellPot/*.go
FROM gcr.io/distroless/static-debian11
COPY --from=build /go/src/app/HellPot /app
COPY --from=build /go/src/app/docker_config.toml /config
EXPOSE 8080
ENTRYPOINT ["/app", "-c", "/config"]