Fix Dockerfile

Change-Id: Ia9b5d3739f6a95a1e633a433cf4bedc4948a7619
diff --git a/.dockerignore b/.dockerignore
index 0cda020..3804b96 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,7 +1,9 @@
 *
 !templates/main.html
+!i18n
 !go.mod
 !go.sum
+!testdata
 !service.go
 !service_test.go
 !LICENSE
\ No newline at end of file
diff --git a/Changes b/Changes
index 2eec9c0..5172519 100755
--- a/Changes
+++ b/Changes
@@ -1,6 +1,10 @@
+0.1.4 2024-03-15
+        - Update dependencies
+        - Fix docker image
+
 0.1.3 2023-10-10
         - Update dependencies
-        - Release to Zenodo.
+        - Release to Zenodo
 
 0.1.2 2023-09-05
         - Log server port
diff --git a/Dockerfile b/Dockerfile
index 888f40e..7b2d1d1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,9 @@
 # Build stage
 FROM golang:latest as build
+
+RUN apt-get update && \
+  apt-get upgrade -y ca-certificates
+
 WORKDIR /src
 
 COPY go.mod go.sum ./
@@ -7,31 +11,39 @@
 
 COPY . /src
 
-RUN apt-get update && \
-  apt-get upgrade -y ca-certificates
+RUN CGO_ENABLED=0 go test .
 
-RUN go test .
+# Build static
+RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
+    go build -v \
+    -ldflags "-extldflags '-static' -s -w" \
+    --trimpath \
+    -o /src/external-big .
 
-RUN STATIC="-extldflags '-static'" \
-    STATICENV="CGO_ENABLED=0 GOOS=linux GOARCH=amd64" \
-    go build -o /src/kalamar-plugin-externalresources .
+FROM gruebel/upx:latest as upx
+
+COPY --from=build /src/external-big /external-big
+
+# Compress the binary and copy it to final image
+RUN upx --best --lzma -o /external /external-big
 
 # Main stage
-FROM busybox:glibc
-
-EXPOSE 5722
+FROM scratch AS final
 
 WORKDIR /
 
-COPY --from=build /etc/ssl/certs /etc/ssl/certs
-COPY --from=build /src/kalamar-plugin-externalresources /kalamar-plugin-externalresources
-COPY --from=build /src/templates /templates
+EXPOSE 5722
 
-ENTRYPOINT [ "./kalamar-plugin-externalresources" ]
+COPY --from=build /etc/ssl/certs /etc/ssl/certs
+COPY --from=build /src/templates /templates
+COPY --from=build /src/i18n      /i18n
+COPY --from=upx   /external      /external
+
+ENTRYPOINT [ "/external" ]
 
 LABEL maintainer="korap@ids-mannheim.de"
 LABEL description="Docker Image for Kalamar-Plugin-ExternalResources, a frontend plugin to link texts to external resources"
-LABEL repository="https://github.com/KorAP/..."
+LABEL repository="https://github.com/KorAP/Kalamar-Plugin-ExternalResources"
 
-# docker build -f Dockerfile -t korap/kalamar-plugin-externalresources .
-# docker run --rm --network host -v ${PWD}/db/:/db/:z -v ${PWD}/.env:/.env korap/kalamar-plugin-externalresources
\ No newline at end of file
+# docker build -f Dockerfile -t korap/kalamar-plugin-externalresources:latest .
+# docker run --rm --network host -v ${PWD}/db/:/db/:z -v ${PWD}/.env:/.env korap/kalamar-plugin-externalresources:latest
\ No newline at end of file