| Akron | f09fc56 | 2023-01-11 08:47:21 +0100 | [diff] [blame] | 1 | # Build stage | 
 | 2 | FROM golang:latest as build | 
 | 3 | WORKDIR /src | 
 | 4 |  | 
 | 5 | COPY go.mod go.sum ./ | 
 | 6 | RUN go mod download | 
 | 7 |  | 
 | 8 | COPY . /src | 
 | 9 |  | 
 | 10 | RUN apt-get update && \ | 
 | 11 |   apt-get upgrade -y ca-certificates | 
 | 12 |  | 
 | 13 | RUN go test . | 
 | 14 |  | 
 | 15 | RUN go build -o /src/kalamar-plugin-externalresources . | 
 | 16 |  | 
 | 17 | # Main stage | 
 | 18 | FROM busybox:glibc | 
 | 19 |  | 
 | 20 | EXPOSE 5722 | 
 | 21 |  | 
 | 22 | WORKDIR / | 
 | 23 |  | 
 | 24 | COPY --from=build /etc/ssl/certs /etc/ssl/certs | 
 | 25 | COPY --from=build /src/kalamar-plugin-externalresources /kalamar-plugin-externalresources | 
 | 26 | COPY --from=build /src/templates /templates | 
 | 27 |  | 
 | 28 | ENTRYPOINT [ "./kalamar-plugin-externalresources" ] | 
 | 29 |  | 
 | 30 | LABEL maintainer="korap@ids-mannheim.de" | 
 | 31 | LABEL description="Docker Image for Kalamar-Plugin-ExternalResources, a frontend plugin to link texts to external resources" | 
 | 32 | LABEL repository="https://github.com/KorAP/..." | 
 | 33 |  | 
 | 34 | # docker build -f Dockerfile -t korap/kalamar-plugin-externalresources . | 
 | 35 | # docker run --rm --network host -v ${PWD}/db/:/db/:z -v ${PWD}/.env:/.env korap/kalamar-plugin-externalresources |