mirror of
https://github.com/imartinez/privateGPT.git
synced 2025-04-27 11:21:34 +00:00
* fix: docker copying extra files * feat: allow configuring mode through env vars * feat: Attempt to build and tag a docker image * fix: run docker on release * fix: typing in prompt transformation * chore: remove tutorial comments
46 lines
1.1 KiB
Docker
46 lines
1.1 KiB
Docker
### IMPORTANT, THIS IMAGE CAN ONLY BE RUN IN LINUX DOCKER
|
|
### You will run into a segfault in mac
|
|
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"
|
|
|
|
# Dependencies to build llama-cpp and wget
|
|
RUN apt update && apt install -y \
|
|
libopenblas-dev\
|
|
ninja-build\
|
|
build-essential\
|
|
pkg-config\
|
|
wget
|
|
|
|
# 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 --with ui
|
|
|
|
FROM base as app
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV PORT=8080
|
|
ENV PGPT_PROFILES=docker
|
|
EXPOSE 8080
|
|
|
|
# Prepare a non-root user
|
|
RUN adduser --system worker
|
|
WORKDIR /home/worker/app
|
|
|
|
RUN mkdir "local_data"; chown worker local_data
|
|
COPY --chown=worker --from=dependencies /home/worker/app/.venv/ .venv
|
|
COPY --chown=worker private_gpt/ private_gpt
|
|
COPY --chown=worker docs/ docs
|
|
COPY --chown=worker *.yaml *.md ./
|
|
|
|
USER worker
|
|
ENTRYPOINT .venv/bin/python -m private_gpt |