-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (26 loc) · 1.27 KB
/
Dockerfile
File metadata and controls
37 lines (26 loc) · 1.27 KB
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
FROM ubuntu:latest
RUN apt update -y && apt upgrade -y && apt install -y python3.11 python3-pip unzip git
RUN pip install --upgrade pip
# Install Torch without GPU. Saves about 7GB on image size
# https://github.com/UKPLab/sentence-transformers/issues/1409
RUN pip3 install wget numpy PyMuPDF rank_bm25 flask transformers tqdm scikit-learn scipy nltk sentencepiece Pillow python-telegram-bot
RUN pip3 install torch --index-url https://download.pytorch.org/whl/cpu
RUN pip3 install --no-deps sentence-transformers
# Download model weights
RUN python3 -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-mpnet-base-v2');"
RUN git clone https://github.com/emielsteerneman/TDP.git /app
WORKDIR /app
COPY TDPs/ TDPs/
COPY images/ images/
COPY static/tdps static/tdps
COPY thumbnails/ thumbnails/
COPY database.db database.db
#RUN python3 download_tdps.py
#RUN python3 fill_database.py
# Open up Flask port
EXPOSE 5000
# Force rebuilding from the 'git pull' layer if there have been new commits
# https://stackoverflow.com/questions/56945125/force-docker-to-rebuild-a-layer-based-on-latest-commit-of-a-git-repo
ADD https://api.github.com/repos/emielsteerneman/TDP/git/refs/heads/master version.json
RUN git pull
ENTRYPOINT python3 app.py