Morgan Funtowicz commited on
Commit
2a31de5
·
1 Parent(s): e5ab730

feat(embeddings): initial dockerfile setup

Browse files
Files changed (2) hide show
  1. Dockerfile +18 -0
  2. requirements.txt +3 -0
Dockerfile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ARG SDK_VERSION=latest
2
+ FROM huggingface/hfendpoints-sdk:${SDK_VERSION} AS sdk
3
+
4
+ FROM python:3.12-bookworm
5
+ RUN --mount=type=bind,from=sdk,source=/opt/hfendpoints/dist,target=/usr/local/endpoints/dist \
6
+ --mount=type=bind,source=requirements.txt,target=/tmp/requirements.txt \
7
+ python3 -m pip install torch --index-url https://download.pytorch.org/whl/cpu && \
8
+ python3 -m pip install -r /tmp/requirements.txt && \
9
+ python3 -m pip install /usr/local/endpoints/dist/*.whl
10
+
11
+ COPY handler.py /usr/local/endpoint/
12
+
13
+ ENV INTERFACE=0.0.0.0
14
+ ENV PORT=80
15
+
16
+ EXPOSE 80
17
+ ENTRYPOINT ["python3"]
18
+ CMD ["/usr/local/endpoint/handler.py"]
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ loguru>=0.7.3
2
+ sentence-transformers
3
+ torch>=2.5.0