added preview installation

This commit is contained in:
Alexander Karpov 2023-08-17 01:05:56 +03:00
parent 13346c0fb4
commit 703d9a681f
7 changed files with 1375 additions and 563 deletions

View File

@ -9,6 +9,7 @@ Writen in Python 3.11 and Django 4.2
### installation ### installation
```shell ```shell
$ poetry install & poetry shell $ poetry install & poetry shell
$ ./spacy_setup.sh
$ python3 manage.py migrate $ python3 manage.py migrate
``` ```
@ -25,6 +26,10 @@ $ uvicorn redirect.app:app --reload
```shell ```shell
$ docker-compose -f local.yml up $ docker-compose -f local.yml up
``` ```
Install file preview dependencies
```shell
$ docker-compose -f local.yml exec django /install_preview_dependencies
```
- server - http://127.0.0.1:8000 - server - http://127.0.0.1:8000
- mail - http://127.0.0.1:8025 - mail - http://127.0.0.1:8025
@ -44,3 +49,4 @@ $ mypy --config-file setup.cfg akarpov
- test platform - test platform
- short link generator - short link generator
- about me app - about me app
- gallery

View File

@ -50,6 +50,10 @@ COPY ./compose/local/django/start /start
RUN sed -i 's/\r$//g' /start RUN sed -i 's/\r$//g' /start
RUN chmod +x /start RUN chmod +x /start
COPY ./compose/local/django/spacy_setup /spacy_setup
RUN sed -i 's/\r$//g' /spacy_setup
RUN chmod +x /spacy_setup
COPY ./compose/local/django/install_preview_dependencies /install_preview_dependencies COPY ./compose/local/django/install_preview_dependencies /install_preview_dependencies
RUN sed -i 's/\r$//g' /install_preview_dependencies RUN sed -i 's/\r$//g' /install_preview_dependencies
RUN chmod +x /install_preview_dependencies RUN chmod +x /install_preview_dependencies

View File

@ -3,8 +3,11 @@
apt-get update apt-get update
apt-get install -y poppler-utils libfile-mimeinfo-perl ghostscript libsecret-1-0 zlib1g-dev libjpeg-dev imagemagick libmagic1 libreoffice inkscape xvfb apt-get install -y poppler-utils libfile-mimeinfo-perl ghostscript libsecret-1-0 zlib1g-dev libjpeg-dev imagemagick libmagic1 libreoffice inkscape xvfb
apt-get install -y libxml2-dev libxslt1-dev antiword unrtf pstotext tesseract-ocr flac lame libmad0 libsox-fmt-mp3 sox swig apt-get install -y libxml2-dev libxslt1-dev antiword unrtf pstotext tesseract-ocr flac lame libmad0 libsox-fmt-mp3 sox swig
apt-get install -y python-dev libxml2-dev libxslt1-dev antiword unrtf poppler-utils pstotext tesseract-ocr \
flac ffmpeg lame libmad0 libsox-fmt-mp3 sox libjpeg-dev swig
wget https://github.com/jgraph/drawio-desktop/releases/download/v13.0.3/draw.io-amd64-13.0.3.deb wget https://github.com/jgraph/drawio-desktop/releases/download/v13.0.3/draw.io-amd64-13.0.3.deb
dpkg -i draw.io-amd64-13.0.3.deb dpkg -i draw.io-amd64-13.0.3.deb
/spacy_setup
rm draw.io-amd64-13.0.3.deb rm draw.io-amd64-13.0.3.deb
apt-get purge -y --auto-remove -o APT:AutoRemove:RecommendsImportant=false && \ apt-get purge -y --auto-remove -o APT:AutoRemove:RecommendsImportant=false && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*

View File

@ -0,0 +1,3 @@
python -m spacy download en_core_web_lg
python -m spacy download xx_sent_ud_sm
python -m spacy download ru_core_news_lg

1916
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -100,6 +100,8 @@ yt-dlp = "^2023.7.6"
pytube = "^15.0.0" pytube = "^15.0.0"
urllib3 = ">=1.26" urllib3 = ">=1.26"
requests = ">=2.25" requests = ">=2.25"
spacy = {extras = ["lookups"], version = "^3.6.1"}
spacy-transformers = "^1.2.5"
[build-system] [build-system]

4
spacy_setup.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
python -m spacy download en_core_web_lg
python -m spacy download xx_sent_ud_sm
python -m spacy download ru_core_news_lg