-
Notifications
You must be signed in to change notification settings - Fork 2
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
23 additions
and
4 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 |
---|---|---|
@@ -1,7 +1,26 @@ | ||
FROM golang:1.16.3 | ||
FROM golang:1.16.3-stretch AS builder | ||
LABEL AUTHOR Seungkyu Ahn ([email protected]) | ||
|
||
RUN mkdir -p /build | ||
WORKDIR /build | ||
|
||
WORKDIR /go/src/tks-contract | ||
COPY . . | ||
RUN go mod tidy && go mod vendor | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/server ./cmd/server | ||
|
||
RUN mkdir -p /dist | ||
WORKDIR /dist | ||
RUN cp /build/bin/server ./server | ||
|
||
|
||
|
||
FROM golang:alpine3.13 | ||
|
||
RUN mkdir -p /app | ||
WORKDIR /app | ||
|
||
COPY --chown=0:0 --from=builder /dist /app/ | ||
EXPOSE 9110 | ||
|
||
RUN go get -d -v ./... | ||
RUN go install -v ./... | ||
ENTRYPOINT ["/app/server"] | ||
CMD ["-port", "9110"] |