kemokemo 0c54286909 Apply GIN_MODE=release for the Dockerfile of go-gin-server (#2283)
* chore: apply release mode for the Dockerfile

* docs: update by `./bin/go-gin-petstore-server.sh`

* docs: update by `./bin/openapi3/go-gin-petstore-server.sh`
2019-03-04 22:24:12 +08:00

16 lines
306 B
Docker

FROM golang:1.10 AS build
WORKDIR /go/src
COPY go ./go
COPY main.go .
ENV CGO_ENABLED=0
RUN go get -d -v ./...
RUN go build -a -installsuffix cgo -o petstoreserver .
FROM scratch AS runtime
ENV GIN_MODE=release
COPY --from=build /go/src/petstoreserver ./
EXPOSE 8080/tcp
ENTRYPOINT ["./petstoreserver"]