summaryrefslogtreecommitdiff
path: root/Dockerfile
blob: ceffaa6f66dedbb21bcf5396374d3482b1c259aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
FROM golang:1.12 as builder

ARG MODE=bot
ARG PROXY=
WORKDIR /usr/src
COPY go.mod go.mod
COPY go.sum go.sum
RUN GOPROXY=${PROXY} go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o transport ./${MODE}

FROM alpine:latest

RUN apk update && apk add --no-cache --virtual ca-certificates
WORKDIR /usr/app
COPY --from=builder /usr/src/transport .
CMD ["./transport"]