Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
seungkyua authored Aug 23, 2021
1 parent bb3ea9f commit 9fdd8d5
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions Dockerfile
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"]

0 comments on commit 9fdd8d5

Please sign in to comment.