Adrià Vilanova MartÃnez | f7ee658 | 2021-09-02 21:53:28 +0200 | [diff] [blame] | 1 | FROM golang:latest as builder |
| 2 | |
| 3 | ENV CGO_ENABLED=0 |
| 4 | |
| 5 | ENV GO111MODULE=on |
| 6 | ENV GOPROXY=https://proxy.golang.org |
| 7 | |
| 8 | RUN mkdir /gocache |
| 9 | ENV GOCACHE /gocache |
| 10 | |
| 11 | WORKDIR /go/src/gomodules.avm99963.com/twpt-server |
| 12 | COPY go.mod /go/src/gomodules.avm99963.com/twpt-server/go.mod |
| 13 | COPY go.sum /go/src/gomodules.avm99963.com/twpt-server/go.sum |
| 14 | COPY cmd /go/src/gomodules.avm99963.com/twpt-server/cmd |
| 15 | COPY internal /go/src/gomodules.avm99963.com/twpt-server/internal |
| 16 | COPY api_proto /go/src/gomodules.avm99963.com/twpt-server/api_proto |
| 17 | |
| 18 | WORKDIR /go/src/gomodules.avm99963.com/twpt-server/cmd/server |
| 19 | RUN go install gomodules.avm99963.com/twpt-server/cmd/server |
| 20 | |
| 21 | FROM alpine |
| 22 | LABEL maintainer "me@avm99963.com" |
| 23 | |
| 24 | RUN apk add --no-cache tini |
| 25 | COPY --from=builder /go/bin/server / |
| 26 | ENTRYPOINT ["/sbin/tini", "--", "/server"] |