File tree Expand file tree Collapse file tree 5 files changed +566
-560
lines changed Expand file tree Collapse file tree 5 files changed +566
-560
lines changed Original file line number Diff line number Diff line change 39
39
uses : docker/build-push-action@v5
40
40
with :
41
41
context : .
42
+ file : Dockerfile.external
42
43
push : true
43
44
tags : ${{ steps.meta.outputs.tags }}
44
45
labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change
1
+ FROM python:3.11.6-slim-bookworm as base
2
+
3
+ # Install poetry
4
+ RUN pip install pipx
5
+ RUN python3 -m pipx ensurepath
6
+ RUN pipx install poetry
7
+ ENV PATH="/root/.local/bin:$PATH"
8
+
9
+ # https://python-poetry.org/docs/configuration/#virtualenvsin-project
10
+ ENV POETRY_VIRTUALENVS_IN_PROJECT=true
11
+
12
+ FROM base as dependencies
13
+ WORKDIR /home/worker/app
14
+ COPY pyproject.toml poetry.lock ./
15
+
16
+ RUN poetry install --with ui
17
+
18
+ FROM base as app
19
+
20
+ ENV PYTHONUNBUFFERED=1
21
+ ENV PORT=8080
22
+ EXPOSE 8080
23
+
24
+ # Prepare a non-root user
25
+ RUN adduser --system worker
26
+ WORKDIR /home/worker/app
27
+
28
+ RUN mkdir local_data; chown worker local_data
29
+ RUN mkdir models; chown worker models
30
+ COPY --chown=worker --from=dependencies /home/worker/app/.venv/ .venv
31
+ COPY --chown=worker private_gpt/ private_gpt
32
+ COPY --chown=worker docs/ docs
33
+ COPY --chown=worker *.yaml *.md ./
34
+
35
+ USER worker
36
+ ENTRYPOINT .venv/bin/python -m private_gpt
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ RUN python3 -m pipx ensurepath
8
8
RUN pipx install poetry
9
9
ENV PATH="/root/.local/bin:$PATH"
10
10
11
- # Dependencies to build llama-cpp and wget
11
+ # Dependencies to build llama-cpp
12
12
RUN apt update && apt install -y \
13
13
libopenblas-dev\
14
14
ninja-build\
@@ -23,13 +23,13 @@ FROM base as dependencies
23
23
WORKDIR /home/worker/app
24
24
COPY pyproject.toml poetry.lock ./
25
25
26
+ RUN poetry install --with local
26
27
RUN poetry install --with ui
27
28
28
29
FROM base as app
29
30
30
31
ENV PYTHONUNBUFFERED=1
31
32
ENV PORT=8080
32
- ENV PGPT_PROFILES=docker
33
33
EXPOSE 8080
34
34
35
35
# Prepare a non-root user
You can’t perform that action at this time.
0 commit comments