forked from Quansight/ragna
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (24 loc) · 1.18 KB
/
Dockerfile
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
FROM python:3.11
WORKDIR /opt/ragna
COPY requirements-docker.lock .
RUN pip install --progress-bar=off --no-deps --no-cache --requirement requirements-docker.lock
# Pre-download the default embedding model
RUN python -c "from chromadb.utils.embedding_functions import ONNXMiniLM_L6_V2; ONNXMiniLM_L6_V2()._download_model_if_not_exists()"
COPY ragna ./ragna
COPY pyproject.toml .
# Since we don't copy the .git folder, but still use setuptools-scm as build-backend
# we need to make two manual changes:
# 1. With setuptools-scm all files that are tracked by git are automatically included in
# the built wheel. Since we have corresponding .dockerignore file to our .gitignore,
# the ragna folder only includes files that we are tracking. Thus, we just include
# everything manually.
# 2. We need to pass the version expliclitly as
# --build-arg SETUPTOOLS_SCM_PRETEND_VERSION_FOR_RAGNA=...,
# since setuptools-scm cannot infer the version
RUN echo '[tool.setuptools.package-data]\n"*" = ["*"]' >> pyproject.toml
ARG SETUPTOOLS_SCM_PRETEND_VERSION_FOR_RAGNA
RUN pip install --progress-bar=off --no-deps .
WORKDIR /var/ragna
COPY ragna-docker.toml ragna.toml
ENTRYPOINT ["ragna"]
CMD ["ui"]