Go-Templates/Dockerfile

12 lines
248 B
Docker
Raw Permalink Normal View History

2023-02-22 16:18:51 +00:00
FROM golang:1.20-alpine as builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -o main .
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root
COPY --from=builder /app/main .
ENTRYPOINT ["./main"]