-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
110 lines (84 loc) · 4.61 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#No GPU support needed by now...
from nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
ENV BINPATH=/opt/bin
#ENV LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
ENV LC_ALL=C
RUN mkdir -p /work/
RUN mkdir -p /work/img/
RUN mkdir -p /work/scripts/
RUN mkdir -p /work/scripts/resources/
RUN mkdir -p /work/uploaded_corpora/
RUN mkdir -p /work/yaml_dir/
RUN mkdir -p /work/venvs/
#TO DO: uploaded_corpora and yaml_dir should be volumes
COPY deployment/requirements.txt /work/deployment/requirements.txt
RUN apt-get update && \
apt-get install -y wget unzip joe gcc libboost-all-dev cmake && \
apt-get install -y python3.10 python3-dev python3.10-dev python3-pip python3.10-venv && \
apt-get install -y git build-essential autoconf autopoint libtool parallel &&\
apt-get install -y hunspell libhunspell-dev jq zstd
RUN python3.10 -m pip install -U pip && \
python3.10 -m pip install -U wheel && \
python3.10 -m pip install -U setuptools
RUN python3.10 -m venv /work/venvs/venv-mc
RUN python3.10 -m venv /work/venvs/venv-bhr
RUN python3.10 -m venv /work/venvs/venv-bc
RUN python3.10 -m venv /work/venvs/venv-bcai
RUN python3.10 -m venv /work/venvs/venv-bnlp
RUN cd /work && git clone https://github.com/ZJaume/tmxt && git clone https://github.com/kpu/preprocess && cd
RUN cd /work/preprocess && rm -fr build && mkdir build && cd build && cmake .. && make && cd
RUN . /work/venvs/venv-mc/bin/activate && \
python3.10 -m pip install -U pip && \
python3.10 -m pip install -U wheel && \
python3.10 -m pip install -U setuptools && \
python3.10 -m pip install --config-settings="--build-option=--max_order=7" https://github.com/kpu/kenlm/archive/master.zip && \
python3.10 -m pip install git+https://github.com/MSeal/[email protected] &&\
python3.10 -m pip install monocleaner==1.6.3 && deactivate
RUN . /work/venvs/venv-bhr/bin/activate && \
python3.10 -m pip install -U pip && \
python3.10 -m pip install -U wheel && \
python3.10 -m pip install -U setuptools && \
python3.10 -m pip install git+https://github.com/MSeal/[email protected] &&\
python3.10 -m pip install --config-settings="--build-option=--max_order=7" https://github.com/kpu/kenlm/archive/master.zip && \
python3.10 -m pip install bicleaner-hardrules==2.10.6 &&\
python3.10 -m pip install "numpy<2" && deactivate
RUN . /work/venvs/venv-bc/bin/activate && \
python3.10 -m pip install -U pip && \
python3.10 -m pip install -U wheel && \
python3.10 -m pip install -U setuptools && \
python3.10 -m pip install --config-settings="--build-option=--max_order=7" https://github.com/kpu/kenlm/archive/master.zip && \
python3.10 -m pip install bicleaner==0.17.2 && deactivate
RUN . /work/venvs/venv-bcai/bin/activate && \
python3.10 -m pip install -U pip && \
python3.10 -m pip install -U wheel && \
python3.10 -m pip install -U setuptools && \
python3.10 -m pip install git+https://github.com/MSeal/[email protected] &&\
python3.10 -m pip install --config-settings="--build-option=--max_order=7" https://github.com/kpu/kenlm/archive/master.zip && \
python3.10 -m pip install bicleaner-ai==3.1.0 && deactivate
RUN . /work/venvs/venv-bnlp/bin/activate && \
python3.10 -m pip install -U pip && \
python3.10 -m pip install -U wheel && \
python3.10 -m pip install -U setuptools && \
python3.10 -m pip install git+https://github.com/MSeal/[email protected] &&\
python3.10 -m pip install -r /work/deployment/requirements.txt &&\
cd /work && rm -rf etnltk && git clone https://github.com/robeleq/etnltk.git && cd etnltk && python3.10 -m pip install . &&\
python3.10 -m pip install bnlp-toolkit==4.0.3 &&\
echo "import nltk; nltk.download('punkt'); nltk.download('punkt_tab'); nltk.download('stopwords');" | python3.10
RUN python3.10 -m pip install git+https://github.com/MSeal/[email protected] &&\
python3.10 -m pip install -r /work/deployment/requirements.txt &&\
echo "import nltk; nltk.download('punkt'); nltk.download('punkt_tab'); nltk.download('stopwords');" | python3.10
COPY *.html /work/
COPY favicon.ico /work/
COPY img/ /work/img/
COPY server.py /work/
COPY scripts/ /work/scripts/
RUN cd /work && git clone https://github.com/pablop16n/web-docs-scorer && cd web-docs-scorer && git checkout tags/1.0.0 && python3.10 -m pip install .
RUN cd /work && cd etnltk && python3.10 -m pip install .
COPY deployment/docker-entrypoint.sh /work/deployment/docker-entrypoint.sh
EXPOSE 8000
RUN chmod +x /work/deployment/*.sh
RUN chmod +x /work/scripts/*.sh
WORKDIR /work
#CMD ["tail", "-f", "/dev/null"]
CMD /work/deployment/docker-entrypoint.sh