-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (27 loc) · 1.34 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 1. Builder image
FROM alpine:3.17 AS builder
# Clone latest dictionaries
WORKDIR /root
RUN apk add --no-cache git
RUN git clone --depth 1 -o 5ede45bb705d3f9f525ea779f7b487f9fc062013 https://github.com/wooorm/dictionaries.git
# 2. Runtime image
FROM alpine:3.17
WORKDIR /spell
RUN apk add --no-cache hunspell
# Copy only required dictionaries
RUN sh -c 'mkdir -pv /usr/share/hunspell'
COPY --from=builder /root/dictionaries/dictionaries/en/index.aff /usr/share/hunspell/default.aff
COPY --from=builder /root/dictionaries/dictionaries/en/index.dic /usr/share/hunspell/default.dic
COPY --from=builder /root/dictionaries/dictionaries/de-CH/index.aff /usr/share/hunspell/de.aff
COPY --from=builder /root/dictionaries/dictionaries/de-CH/index.dic /usr/share/hunspell/de.dic
COPY --from=builder /root/dictionaries/dictionaries/fr/index.aff /usr/share/hunspell/fr.aff
COPY --from=builder /root/dictionaries/dictionaries/fr/index.dic /usr/share/hunspell/fr.dic
# Copy exclusion file as custom "vshn" dictionary as explained here:
# https://www.suares.com/?page_id=25&news_id=233
COPY hunspell_exclude .
RUN wc -l hunspell_exclude > /usr/share/hunspell/vshn.dic
RUN sort hunspell_exclude | uniq >> /usr/share/hunspell/vshn.dic
RUN touch /usr/share/hunspell/vshn.aff
# Check version and available dictionaries
RUN hunspell -v && hunspell -D
ENTRYPOINT ["/usr/bin/hunspell"]