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