Skip to content

Commit

Permalink
add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusfm committed Mar 5, 2023
1 parent a7c6a19 commit 9bb8fea
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.20 as builder
ARG TARGETOS
ARG TARGETARCH

WORKDIR /workspace
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download

COPY main.go main.go
COPY cmd/ cmd/
COPY cardversions/ cardversions/
COPY leagueclubs/ leagueclubs/
COPY nations/ nations/
COPY players/ players/

RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o futbin main.go

FROM gcr.io/distroless/static:nonroot
USER 65532:65532
WORKDIR /
COPY --from=builder /workspace/futbin .

ENTRYPOINT ["/futbin"]

0 comments on commit 9bb8fea

Please sign in to comment.