blob: 888f40eb0d4fda6db99d13079834d813632bb368 [file] [log] [blame]
Akronf09fc562023-01-11 08:47:21 +01001# Build stage
2FROM golang:latest as build
3WORKDIR /src
4
5COPY go.mod go.sum ./
6RUN go mod download
7
8COPY . /src
9
10RUN apt-get update && \
11 apt-get upgrade -y ca-certificates
12
13RUN go test .
14
Akron6f4a3482023-11-27 19:48:22 +010015RUN STATIC="-extldflags '-static'" \
16 STATICENV="CGO_ENABLED=0 GOOS=linux GOARCH=amd64" \
17 go build -o /src/kalamar-plugin-externalresources .
Akronf09fc562023-01-11 08:47:21 +010018
19# Main stage
20FROM busybox:glibc
21
22EXPOSE 5722
23
24WORKDIR /
25
26COPY --from=build /etc/ssl/certs /etc/ssl/certs
27COPY --from=build /src/kalamar-plugin-externalresources /kalamar-plugin-externalresources
28COPY --from=build /src/templates /templates
29
30ENTRYPOINT [ "./kalamar-plugin-externalresources" ]
31
32LABEL maintainer="korap@ids-mannheim.de"
33LABEL description="Docker Image for Kalamar-Plugin-ExternalResources, a frontend plugin to link texts to external resources"
34LABEL 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