diff options
-rw-r--r-- | Dockerfile | 17 | ||||
-rw-r--r-- | bot/bot.go (renamed from bot.go) | 0 |
2 files changed, 17 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ceffaa6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,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"] |