Improve docker image

Change-Id: I4e0767497b019e70512e2c7962360f6b0a318658
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..9d24867
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,48 @@
+# Build stage
+FROM golang:latest AS build
+
+RUN apt-get update && \
+  apt-get upgrade -y ca-certificates
+
+WORKDIR /src
+
+COPY go.mod go.sum ./
+RUN go mod download
+
+COPY . /src
+
+RUN CGO_ENABLED=0 go test ./...
+
+# Build static
+RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
+    go build -v \
+    -ldflags "-extldflags '-static' -s -w" \
+    --trimpath \
+    -o /src/termmapper ./cmd/termmapper/
+
+FROM gruebel/upx:latest AS upx
+
+COPY --from=build /src/termmapper /termmapper-big
+
+# Compress the binary and copy it to final image
+RUN upx --best --lzma -o /termmapper /termmapper-big
+
+# Main stage
+FROM scratch AS final
+
+WORKDIR /
+
+EXPOSE 5725
+
+COPY --from=build /etc/ssl/certs /etc/ssl/certs
+COPY --from=build /src/mappings /mappings
+COPY --from=upx   /termmapper      /termmapper
+
+ENTRYPOINT [ "/termmapper" ]
+
+LABEL maintainer="korap@ids-mannheim.de"
+LABEL description="Docker Image for KoralPipe-TermMapper"
+LABEL repository="https://github.com/KorAP/KoralPipe-TermMapper"
+
+# docker build -f Dockerfile -t korap/koralpipe-termmapper:latest .
+# docker run --rm --network host korap/koralpipe-termmapper:latest -m /mappings/*.yaml
\ No newline at end of file