Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +5 -13
Dockerfile
CHANGED
@@ -1,19 +1,16 @@
|
|
1 |
FROM python:3.11.6-slim-bookworm as base
|
2 |
|
3 |
-
# Install poetry
|
4 |
-
RUN pip install
|
5 |
-
RUN python3 -m pipx ensurepath
|
6 |
-
RUN pipx install poetry
|
7 |
-
ENV PATH="/root/.local/bin:$PATH"
|
8 |
|
9 |
-
#
|
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 |
-
#
|
17 |
COPY pyproject.toml poetry.lock ./
|
18 |
RUN poetry config installer.max-workers 10
|
19 |
RUN poetry install --with ui
|
@@ -39,11 +36,6 @@ COPY --chown=worker private_gpt/ private_gpt
|
|
39 |
COPY --chown=worker docs/ docs
|
40 |
COPY --chown=worker *.yaml *.md ./
|
41 |
|
42 |
-
USER root
|
43 |
-
|
44 |
-
# Ensure the poetry binary is executable
|
45 |
-
RUN chmod +x /root/.local/bin/poetry
|
46 |
-
|
47 |
USER worker
|
48 |
|
49 |
CMD ["poetry", "run", "python", "-m", "uvicorn", "private_gpt.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
FROM python:3.11.6-slim-bookworm as base
|
2 |
|
3 |
+
# Install poetry globally
|
4 |
+
RUN pip install poetry
|
|
|
|
|
|
|
5 |
|
6 |
+
# Set up poetry
|
7 |
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
|
8 |
+
ENV PATH="/root/.local/bin:$PATH"
|
9 |
|
10 |
FROM base as dependencies
|
11 |
WORKDIR /home/worker/app
|
|
|
12 |
|
13 |
+
# Copy the project files before running poetry install
|
14 |
COPY pyproject.toml poetry.lock ./
|
15 |
RUN poetry config installer.max-workers 10
|
16 |
RUN poetry install --with ui
|
|
|
36 |
COPY --chown=worker docs/ docs
|
37 |
COPY --chown=worker *.yaml *.md ./
|
38 |
|
|
|
|
|
|
|
|
|
|
|
39 |
USER worker
|
40 |
|
41 |
CMD ["poetry", "run", "python", "-m", "uvicorn", "private_gpt.main:app", "--host", "0.0.0.0", "--port", "7860"]
|