Skip to content

Commit e1d20a2

Browse files
update Dockerfiles (base and main), requirements and some python-libs
1 parent 3581686 commit e1d20a2

File tree

9 files changed

+45
-47
lines changed

9 files changed

+45
-47
lines changed

Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20-alpine as frontend_build
1+
FROM node:20-alpine AS frontend_build
22

33
WORKDIR /app
44
ADD package.json webpack.config.js ./
@@ -7,10 +7,11 @@ RUN npm install && npm install webpack
77
ADD ./assets ./assets
88
RUN npm run build
99

10-
FROM dvivanov/dis-base:v0.4
10+
FROM dvivanov/dis-base:v0.5
1111

1212
LABEL project='dis'
13-
LABEL version='0.4'
13+
LABEL version='0.5'
14+
ENV PYTHONPATH="${PYTHONPATH}:/usr/src/project/app"
1415

1516
WORKDIR /usr/src/project
1617

@@ -19,6 +20,4 @@ ADD ./db_versioning ./db_versioning/
1920
ADD ./app ./app/
2021
COPY --from=frontend_build /app/src ./src/
2122

22-
ENV PYTHONPATH "${PYTHONPATH}:/usr/src/project/app"
23-
24-
CMD ./scripts/local_start.sh
23+
CMD ["./scripts/local_start.sh"]

Dockerfile_base

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
FROM python:3.10-slim-bullseye
1+
FROM python:3.12-slim-bullseye
22

33
LABEL project='dis'
4-
LABEL version='0.4-base'
4+
LABEL version='0.5-base'
55

6-
ENV LANG en_US.UTF-8
6+
ENV LANG=en_US.UTF-8
77
ENV TZ=Europe/Moscow
88

99
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
10-
11-
RUN apt update && apt install -y libreoffice-writer libreoffice-impress default-jre
10+
RUN apt update && apt install -y g++ gcc libreoffice-writer libreoffice-impress default-jre
1211

1312
ADD requirements.txt .
1413
RUN python3 -m pip install -r requirements.txt --no-cache-dir

app/main/checks/base_check.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import pymorphy2
1+
import pymorphy3
22

3-
morph = pymorphy2.MorphAnalyzer()
3+
morph = pymorphy3.MorphAnalyzer()
44

55

66
def answer(mod, *args):

app/main/checks/presentation_checks/find_theme_in_pres.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import nltk
88
from nltk.tokenize import word_tokenize, sent_tokenize
99
from nltk.corpus import stopwords
10-
from pymorphy2 import MorphAnalyzer
10+
from pymorphy3 import MorphAnalyzer
1111

1212

1313
MORPH_ANALYZER = MorphAnalyzer()

app/main/checks/report_checks/find_theme_in_report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import string
77
from nltk.tokenize import word_tokenize, sent_tokenize
88
from nltk.corpus import stopwords
9-
from pymorphy2 import MorphAnalyzer
9+
from pymorphy3 import MorphAnalyzer
1010

1111

1212
MORPH_ANALYZER = MorphAnalyzer()

app/main/checks/report_checks/sw_keywords_check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from nltk.tokenize import word_tokenize
55
from nltk.corpus import stopwords
6-
from pymorphy2 import MorphAnalyzer
6+
from pymorphy3 import MorphAnalyzer
77
from ..base_check import BaseReportCriterion, answer
88

99

app/main/reports/pdf_document/pdf_document_manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# import pdfplumber
3-
import fitz
3+
import pymupdf
44

55

66
from app.utils import convert_to
@@ -9,10 +9,10 @@ class PdfDocumentManager:
99
def __init__(self, path_to_file, pdf_filepath):
1010
if not pdf_filepath:
1111
# self.pdf_file = pdfplumber.open(convert_to(path_to_file, target_format='pdf'))
12-
self.pdf_file = fitz.open(convert_to(path_to_file, target_format='pdf'))
12+
self.pdf_file = pymupdf.open(convert_to(path_to_file, target_format='pdf'))
1313
else:
1414
# self.pdf_file = pdfplumber.open(pdf_filepath)
15-
self.pdf_file = fitz.open(pdf_filepath)
15+
self.pdf_file = pymupdf.open(pdf_filepath)
1616
self.pages = [self.pdf_file.load_page(page_num) for page_num in range(self.pdf_file.page_count)]
1717
self.page_count_all = self.pdf_file.page_count
1818
# self.page_count = len(self.pages)
@@ -34,7 +34,7 @@ def page_images(self, page_without_pril):
3434
total_height = 0
3535
for page_num in range(page_without_pril):
3636
page = self.pdf_file[page_num]
37-
images = self.pdf_file.get_page_images(page)
37+
images = self.pdf_file.get_page_images(page_num)
3838
for image in images:
3939
image_coord = page.get_image_bbox(image[7], transform=0) # might be [1.0, 1.0, -1.0, -1.0]
4040
image_height = image_coord[3] - image_coord[1]

app/nlp/stemming.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import itertools
22
from nltk.corpus import stopwords
33
from nltk.tokenize import word_tokenize, sent_tokenize
4-
from pymorphy2 import MorphAnalyzer
4+
from pymorphy3 import MorphAnalyzer
55

66

77
MORPH_ANALYZER = MorphAnalyzer()

requirements.txt

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
werkzeug==2.0.0
1+
argparse~=1.4.0
2+
celery==5.5.3
3+
configparser~=5.3.0
4+
docx2python~=2.0.4
5+
filetype==1.2.0
26
Flask==2.0.3
3-
jinja2==3.0.0
4-
requests~=2.31.0
5-
python-pptx==0.6.18
6-
odfpy==1.4.1
7-
pymongo==3.11.1
87
flask-login==0.5.0
9-
numpy==1.22
10-
scipy~=1.10.1
11-
pymorphy2==0.9.1
12-
nltk==3.6.6
138
flask-recaptcha==0.4.2
14-
lti==0.9.5
159
flask-security==3.0.0
16-
celery==5.2.2
1710
flower==1.2.0
18-
redis==3.5.3
19-
pandas~=2.0.3
2011
fsspec==2022.2.0
21-
python-docx==0.8.11
22-
odfpy==1.4.1
23-
argparse~=1.4.0
24-
docx2python~=2.0.4
12+
jinja2==3.0.0
13+
language-tool-python==2.8.1
14+
lti==0.9.5
15+
lxml~=4.9.2
16+
markdown==3.4.4
17+
md2pdf==1.0.1
18+
nltk==3.6.6
19+
numpy==1.26.4
2520
oauthlib~=3.1.0
21+
odfpy==1.4.1
22+
odfpy==1.4.1
23+
pandas~=2.0.3
2624
pdfplumber==0.6.1
27-
pytest~=7.1.2
28-
PyMuPDF~=1.22.5
25+
PyMuPDF==1.26.6
2926
PyPDF2~=3.0.1
30-
configparser~=5.3.0
27+
pymongo==3.11.1
28+
pymorphy3==2.0.6
29+
pytest~=7.1.2
30+
python-docx==0.8.11
31+
python-pptx==0.6.18
3132
pytz~=2023.3
32-
lxml~=4.9.2
33+
redis==6.1.0
34+
requests~=2.31.0
35+
scipy~=1.11.1
3336
urllib3~=2.0.3
34-
filetype==1.2.0
35-
language-tool-python==2.8.1
36-
markdown==3.4.4
37-
md2pdf==1.0.1
37+
werkzeug==2.0.0

0 commit comments

Comments
 (0)