-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Prepare | ||
FROM golang:1.13-alpine as baseimg | ||
|
||
RUN apk --no-cache upgrade && apk --no-cache add git make | ||
|
||
# First only download the dependencies, so thid layer can be cahced before we copy the code | ||
COPY ./go.mod ./go.sum ./Makefile /app/ | ||
WORKDIR /app/ | ||
RUN make deps | ||
|
||
# Build | ||
FROM baseimg as builder | ||
|
||
COPY . ./ | ||
RUN make build | ||
|
||
# Run | ||
FROM alpine | ||
|
||
COPY --from=builder /app/go-skeleton /opt/ | ||
WORKDIR /opt/ | ||
ARG ENV | ||
EXPOSE 8000 | ||
CMD ["./go-skeleton"] |