summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorAlexander Kiryukhin <a.kiryukhin@mail.ru>2019-04-17 15:30:49 +0300
committerAlexander Kiryukhin <a.kiryukhin@mail.ru>2019-04-17 15:30:49 +0300
commitdc26124aa3366f141f0be06c56122a2b0357b782 (patch)
treeb6a6fb7f906cfd52d253062483cd1cb2b1e17a54 /Dockerfile
parent5a8fa8ebd73090e7b4488639b051cbf8b476d617 (diff)
RefactoringHEADmaster
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile17
1 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"]