-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
22 lines (22 loc) · 1018 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Docker file for NTI Reader
FROM golang:1.22.1 as builder
ADD https://api.github.com/repos/alexamies/chinesenotes-go/git/refs/heads/master version.json
RUN git clone https://github.com/alexamies/chinesenotes-go.git --branch v0.0.186
WORKDIR /go/chinesenotes-go
COPY *.yaml ./
COPY data/corpus/collections.csv data/corpus/
COPY data/dictionary/*.txt data/dictionary/
COPY data/dictionary/*.tsv data/dictionary/
COPY index/documents.tsv index/
RUN go build
ENV GO111MODULE=on
RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -o cnweb
FROM alpine:3
RUN apk add --no-cache ca-certificates
COPY --from=builder /go/chinesenotes-go/cnweb /cnweb
COPY --from=builder /go/chinesenotes-go/*.yaml /
COPY --from=builder /go/chinesenotes-go/data/corpus/collections.csv data/corpus/
COPY --from=builder /go/chinesenotes-go/data/dictionary/*.txt /data/dictionary/
COPY --from=builder /go/chinesenotes-go/data/dictionary/*.tsv /data/dictionary/
COPY --from=builder /go/chinesenotes-go/index/documents.tsv /index/
CMD ["./cnweb"]