Created
April 4, 2022 20:22
-
-
Save jsonw23/06097984f37e859f8a7e9ae879d86498 to your computer and use it in GitHub Desktop.
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.18 | |
WORKDIR /usr/src/app | |
# pre-fetch the dependencies in a separate layer | |
COPY go.mod go.sum ./ | |
RUN go mod download && go mod verify | |
# copy in the full codebase and build | |
COPY . . | |
RUN go build -v -o /usr/local/bin/app ./ | |
# open the default port and run the executable | |
EXPOSE 8080 | |
CMD ["app"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment