summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile16
1 files changed, 16 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..5e60af2
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,16 @@
+# STEP 1
+FROM golang:1.11-stretch as builder
+COPY . /srv/app
+WORKDIR /srv/app
+#get dependancies
+RUN go mod download
+#build the binary
+RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o /go/bin/app
+
+# STEP 2
+# start from scratch
+FROM scratch
+# Copy our static executable
+WORKDIR /usr/app
+COPY --from=builder /go/bin/app .
+ENTRYPOINT ["./app"] \ No newline at end of file