mirror of
https://github.com/imartinez/privateGPT.git
synced 2025-04-27 11:21:34 +00:00
* Extract optional dependencies * Separate local mode into llms-llama-cpp and embeddings-huggingface for clarity * Support Ollama embeddings * Upgrade to llamaindex 0.10.14. Remove legacy use of ServiceContext in ContextChatEngine * Fix vector retriever filters
40 lines
989 B
Docker
40 lines
989 B
Docker
FROM python:3.11.6-slim-bookworm as base
|
|
|
|
# Install poetry
|
|
RUN pip install pipx
|
|
RUN python3 -m pipx ensurepath
|
|
RUN pipx install poetry
|
|
ENV PATH="/root/.local/bin:$PATH"
|
|
ENV PATH=".venv/bin/:$PATH"
|
|
|
|
# https://python-poetry.org/docs/configuration/#virtualenvsin-project
|
|
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
|
|
|
|
FROM base as dependencies
|
|
WORKDIR /home/worker/app
|
|
COPY pyproject.toml poetry.lock ./
|
|
|
|
RUN poetry install --extras "ui vector-stores-qdrant"
|
|
|
|
FROM base as app
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV PORT=8080
|
|
EXPOSE 8080
|
|
|
|
# Prepare a non-root user
|
|
RUN adduser --system worker
|
|
WORKDIR /home/worker/app
|
|
|
|
RUN mkdir local_data; chown worker local_data
|
|
RUN mkdir models; chown worker models
|
|
COPY --chown=worker --from=dependencies /home/worker/app/.venv/ .venv
|
|
COPY --chown=worker private_gpt/ private_gpt
|
|
COPY --chown=worker fern/ fern
|
|
COPY --chown=worker *.yaml *.md ./
|
|
COPY --chown=worker scripts/ scripts
|
|
|
|
ENV PYTHONPATH="$PYTHONPATH:/private_gpt/"
|
|
|
|
USER worker
|
|
ENTRYPOINT python -m private_gpt |