Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -4
Dockerfile
CHANGED
@@ -16,6 +16,13 @@ COPY pyproject.toml poetry.lock ./
|
|
16 |
# Explicitly copy the project files before running poetry install
|
17 |
COPY pyproject.toml poetry.lock ./
|
18 |
RUN poetry config installer.max-workers 10
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
RUN poetry install --with ui
|
20 |
RUN poetry install --extras chroma
|
21 |
RUN pip install fastapi uvicorn
|
@@ -33,10 +40,6 @@ WORKDIR /home/worker/app
|
|
33 |
# Ensure the worker user has the necessary permissions
|
34 |
RUN mkdir -p local_data/private_gpt/chroma_db && chown -R worker local_data/private_gpt
|
35 |
|
36 |
-
# Activate the virtual environment and install dependencies
|
37 |
-
USER worker
|
38 |
-
RUN poetry install
|
39 |
-
|
40 |
# Ensure the 'meta.json' file has the correct permissions
|
41 |
RUN touch local_data/private_gpt/chroma_db/meta.json && chown worker local_data/private_gpt/chroma_db/meta.json
|
42 |
|
@@ -44,4 +47,5 @@ RUN touch local_data/private_gpt/chroma_db/meta.json && chown worker local_data/
|
|
44 |
RUN chmod 777 local_data/private_gpt/chroma_db
|
45 |
|
46 |
# Activate the virtual environment and run uvicorn
|
|
|
47 |
CMD [".venv/bin/uvicorn", "private_gpt.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
16 |
# Explicitly copy the project files before running poetry install
|
17 |
COPY pyproject.toml poetry.lock ./
|
18 |
RUN poetry config installer.max-workers 10
|
19 |
+
|
20 |
+
# Allow the user to write to the project directory
|
21 |
+
RUN mkdir -p /home/worker/app/local_data/private_gpt/chroma_db && chown -R worker /home/worker/app
|
22 |
+
|
23 |
+
USER worker
|
24 |
+
|
25 |
+
# Install dependencies inside the virtual environment
|
26 |
RUN poetry install --with ui
|
27 |
RUN poetry install --extras chroma
|
28 |
RUN pip install fastapi uvicorn
|
|
|
40 |
# Ensure the worker user has the necessary permissions
|
41 |
RUN mkdir -p local_data/private_gpt/chroma_db && chown -R worker local_data/private_gpt
|
42 |
|
|
|
|
|
|
|
|
|
43 |
# Ensure the 'meta.json' file has the correct permissions
|
44 |
RUN touch local_data/private_gpt/chroma_db/meta.json && chown worker local_data/private_gpt/chroma_db/meta.json
|
45 |
|
|
|
47 |
RUN chmod 777 local_data/private_gpt/chroma_db
|
48 |
|
49 |
# Activate the virtual environment and run uvicorn
|
50 |
+
USER worker
|
51 |
CMD [".venv/bin/uvicorn", "private_gpt.main:app", "--host", "0.0.0.0", "--port", "7860"]
|