Ibraaheem commited on
Commit
480fd29
·
1 Parent(s): f78a720

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -8
Dockerfile CHANGED
@@ -26,12 +26,11 @@ ENV PYTHONUNBUFFERED=1
26
  ENV PORT=7860
27
  EXPOSE 7860
28
 
29
- # Prepare a non-root user
30
- RUN adduser --system worker
31
- WORKDIR /home/worker/app
32
-
33
  # Ensure the worker user has the necessary permissions
34
- RUN mkdir -p local_data/private_gpt/chromadb && chown -R worker local_data/private_gpt
 
 
 
35
 
36
  # Copy only the necessary files for the app
37
  COPY --chown=worker --from=dependencies /home/worker/app/.venv/ .venv
@@ -39,9 +38,7 @@ COPY --chown=worker private_gpt/ private_gpt
39
  COPY --chown=worker docs/ docs
40
  COPY --chown=worker *.yaml *.md ./
41
 
42
-
43
-
44
  USER worker
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"]
 
26
  ENV PORT=7860
27
  EXPOSE 7860
28
 
 
 
 
 
29
  # Ensure the worker user has the necessary permissions
30
+ RUN mkdir -p local_data/private_gpt/chromadb && chown -R worker.local_data/private_gpt
31
+
32
+ # Add the worker user to the staff group
33
+ RUN adduser worker staff
34
 
35
  # Copy only the necessary files for the app
36
  COPY --chown=worker --from=dependencies /home/worker/app/.venv/ .venv
 
38
  COPY --chown=worker docs/ docs
39
  COPY --chown=worker *.yaml *.md ./
40
 
 
 
41
  USER worker
42
 
43
  # Activate the virtual environment and run uvicorn
44
+ CMD [".venv/bin/uvicorn", "private_gpt.main:app", "--host", "0.0.0.0", "--port", "7860"]