-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (21 loc) · 990 Bytes
/
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
FROM python:3.9.7 AS builder
ENV PYTHONUNBUFFERED=True
RUN apt update && apt install -y gcc g++ libffi-dev libc-dev make libsqlite3-dev git perl \
&& git clone --recursive https://github.com/epoz/fts5-snowball.git
WORKDIR /fts5-snowball
RUN make
WORKDIR /spellfix
RUN git clone https://gist.github.com/bda9efcdceb1dda0ba7cd80395a86450.git
RUN gcc -g -shared -fPIC bda9efcdceb1dda0ba7cd80395a86450/spellfix.c -o spellfix.so
WORKDIR /tree_sitter_sparql
RUN git clone https://github.com/epoz/tree-sitter-sparql
RUN pip install tree-sitter==0.20.1
RUN python -c "from tree_sitter import Language; Language.build_library('b/sparql.so', ['tree-sitter-sparql'])"
FROM python:3.9.7
COPY --from=builder /fts5-snowball/fts5stemmer.so /usr/local/lib/
COPY --from=builder /spellfix/spellfix.so /usr/local/lib/
COPY --from=builder /tree_sitter_sparql/b/sparql.so /usr/local/lib
WORKDIR /src
RUN pip install tree-sitter==0.20.1
COPY fizzysearch.py .
ENTRYPOINT ["python", "fizzysearch.py"]