Last active
May 14, 2023 12:01
-
-
Save EvilFreelancer/4d9e675d3bc04980b599633c18702c9e to your computer and use it in GitHub Desktop.
Dockerfile для GoLang-приложения
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.20 AS builder | |
WORKDIR /app | |
COPY . . | |
RUN go mod download | |
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main . | |
FROM alpine:latest | |
RUN apk --no-cache add ca-certificates | |
WORKDIR /app/ | |
COPY --from=builder /app/main . | |
CMD ["/app/main"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment