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 | |
Akron | 6f4a348 | 2023-11-27 19:48:22 +0100 | [diff] [blame] | 15 | RUN STATIC="-extldflags '-static'" \ |
| 16 | STATICENV="CGO_ENABLED=0 GOOS=linux GOARCH=amd64" \ |
| 17 | go build -o /src/kalamar-plugin-externalresources . |
Akron | f09fc56 | 2023-01-11 08:47:21 +0100 | [diff] [blame] | 18 | |
| 19 | # Main stage |
| 20 | FROM busybox:glibc |
| 21 | |
| 22 | EXPOSE 5722 |
| 23 | |
| 24 | WORKDIR / |
| 25 | |
| 26 | COPY --from=build /etc/ssl/certs /etc/ssl/certs |
| 27 | COPY --from=build /src/kalamar-plugin-externalresources /kalamar-plugin-externalresources |
| 28 | COPY --from=build /src/templates /templates |
| 29 | |
| 30 | ENTRYPOINT [ "./kalamar-plugin-externalresources" ] |
| 31 | |
| 32 | LABEL maintainer="korap@ids-mannheim.de" |
| 33 | LABEL description="Docker Image for Kalamar-Plugin-ExternalResources, a frontend plugin to link texts to external resources" |
| 34 | LABEL repository="https://github.com/KorAP/..." |
| 35 | |
| 36 | # docker build -f Dockerfile -t korap/kalamar-plugin-externalresources . |
| 37 | # docker run --rm --network host -v ${PWD}/db/:/db/:z -v ${PWD}/.env:/.env korap/kalamar-plugin-externalresources |