-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (31 loc) · 867 Bytes
/
Dockerfile
File metadata and controls
40 lines (31 loc) · 867 Bytes
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
FROM nvidia/cuda:12.1.0-base-ubuntu18.04
# Install some basic utilities
RUN apt-get update && apt-get install python3 python3-pip -y
# Install some basic utilities
RUN apt-get install -y \
curl \
ca-certificates \
sudo \
git \
bzip2 \
libx11-6 \
build-essential \
wget \
unzip \
&& rm -rf /var/lib/apt/lists/*
RUN sudo apt-get update
# Create a working directory
RUN mkdir /app
WORKDIR /app/
# Install requirements
ADD requirements.txt /app/
RUN pip3 install pip -U
RUN pip3 install -r requirements.txt
# Download Sentence Transformers Model
RUN python3 -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ.get('MODEL', 'all-MiniLM-L6-v2'));"
# Move required resources
ADD app.py /app/
EXPOSE 5000
# Run flask api
ENTRYPOINT ["python3"]
CMD ["app.py"]