|
|
|
|
|
|
|
|
|
ARG MODEL="nomic-ai/nomic-embed-text-v1.5" |
|
|
|
FROM debian:bullseye-slim AS build-image |
|
|
|
|
|
ARG MODEL |
|
ENV MODEL=${MODEL} |
|
|
|
COPY ./download.sh ./ |
|
|
|
|
|
RUN apt-get update && \ |
|
apt-get install -y git-lfs |
|
|
|
RUN chmod +x *.sh && \ |
|
./download.sh && \ |
|
rm *.sh |
|
|
|
|
|
|
|
FROM python:3.11-slim |
|
|
|
|
|
ARG MODEL |
|
ENV MODEL=${MODEL} |
|
ENV NORMALIZE_EMBEDDINGS=1 |
|
ENV HF_HOME="/tmp/hf_home" |
|
|
|
ENV HOST=0.0.0.0 |
|
ENV PORT=7860 |
|
|
|
COPY --from=build-image ${MODEL} ${MODEL} |
|
COPY ./main.py ./ |
|
COPY ./start_server.sh ./ |
|
COPY ./patch.py ./ |
|
|
|
RUN pip install -U pip && pip install --no-cache-dir open-text-embeddings[server] langchain_community einops && \ |
|
chmod +x ./*.sh && python patch.py |
|
|
|
|
|
EXPOSE ${PORT} |
|
|
|
|
|
CMD ["/bin/sh", "./start_server.sh"] |
|
|