github.com/miguelgrubin/gin-boilerplate@v0.0.0-20231208120009-f8f00c6d4138/Dockerfile (about)

     1  # syntax=docker/dockerfile:1
     2  FROM golang:1.21-alpine as build
     3  RUN apk add --no-cache gcc g++ git openssh-client
     4  
     5  WORKDIR /src
     6  COPY . .
     7  RUN go mod download
     8  RUN CGO_ENABLED=1 go build -o /bin/app ./main.go
     9  
    10  FROM alpine:latest
    11  COPY --from=build /bin/app /bin/app
    12  EXPOSE 8080
    13  CMD ["/bin/app"]