-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-docsim
52 lines (42 loc) · 2.04 KB
/
Dockerfile-docsim
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
FROM node:16-buster AS compile-image
# FROM node:lts-buster AS compile-image
COPY ./ui /app/ui
WORKDIR /app/ui
RUN npm install \
&& npm run build-ukr \
&& npm run build-eng \
&& rm -r ./node_modules
FROM python:3.8-slim
LABEL maintainer "Kyrylo Malakhov <[email protected]> and Vitalii Velychko <[email protected]> and Oleksandr Shchurov <[email protected]>"
LABEL description "docsim - An NLU-Powered tool for knowledge discovery, classification, diagnostics and prediction."
COPY ./server /docsim/server
WORKDIR /docsim/server/
RUN mkdir -p /static/ukr \
&& mkdir -p /static/eng
COPY --from=compile-image /app/ui/dist/ukr/* /docsim/server/static/ukr/
COPY --from=compile-image /app/ui/dist/ukr/index.html /docsim/server/templates/index-ukr.html
COPY --from=compile-image /app/ui/dist/eng/en/* /docsim/server/static/eng/
COPY --from=compile-image /app/ui/dist/eng/en/index.html /docsim/server/templates/index-eng.html
# Expose the port uWSGI will listen on
EXPOSE 5000
RUN apt-get -y clean \
&& apt-get -y update \
# && apt-get -y install python-dev \
&& apt-get -y install python3-dev \
&& apt-get -y install build-essential \
&& apt-get -y install unzip \
&& apt-get -y install bzip2 \
&& apt-get -y install wget \
&& apt-get -y install curl \
&& pip install -r ./deploy/requirements.txt --src /usr/local/src \
# Download models
&& wget -O ./models/fiction.lowercased.lemmatized.word2vec.300d.bz2 https://lang.org.ua/static/downloads/models/fiction.lowercased.lemmatized.word2vec.300d.bz2 \
&& bzip2 -d ./models/fiction.lowercased.lemmatized.word2vec.300d.bz2 \
&& wget -O ./models/ubercorpus.lowercased.lemmatized.word2vec.300d.bz2 https://lang.org.ua/static/downloads/models/ubercorpus.lowercased.lemmatized.word2vec.300d.bz2 \
&& bzip2 -d ./models/ubercorpus.lowercased.lemmatized.word2vec.300d.bz2 \
&& rm -r /root/.cache \
&& apt-get -y clean \
&& apt-get -y autoremove
# Finally, we run uWSGI with the ini file we
# created earlier
CMD ["uwsgi", "--ini", "./deploy/uwsgi.ini"]