dkdaniz commited on
Commit
2abee9d
1 Parent(s): cb713a3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -12
Dockerfile CHANGED
@@ -26,16 +26,26 @@ RUN python -m pip install --upgrade pip pytest cmake \
26
  scikit-build setuptools fastapi uvicorn sse-starlette \
27
  pydantic-settings starlette-context gradio huggingface_hub hf_transfer
28
 
29
- # ENV HOME=/home/user \
30
- # PATH=/home/user/.local/bin:$PATH \
31
- # PYTHONPATH=$HOME/app \
32
- # PYTHONUNBUFFERED=1 \
33
- # GRADIO_ALLOW_FLAGGING=never \
34
- # GRADIO_NUM_PORTS=1 \
35
- # GRADIO_SERVER_NAME=0.0.0.0 \
36
- # GRADIO_THEME=huggingface \
37
- # SYSTEM=spaces
38
-
39
  RUN CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
40
-
41
- CMD sh -c "chmod -R 777 -c ./run.sh && ./run.sh"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  scikit-build setuptools fastapi uvicorn sse-starlette \
27
  pydantic-settings starlette-context gradio huggingface_hub hf_transfer
28
 
 
 
 
 
 
 
 
 
 
 
29
  RUN CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
30
+ RUN CMAKE_ARGS="-DLLAMA_CUBLAS=on" FORCE_CMAKE=1 pip install --timeout 100 -r requirements.txt
31
+
32
+ RUN useradd -m -u 1000 user
33
+ # Switch to the "user" user
34
+ USER user
35
+ # Set home to the user's home directory
36
+ ENV HOME=/home/user \
37
+ PATH=/home/user/.local/bin:$PATH \
38
+ PYTHONPATH=$HOME/app \
39
+ PYTHONUNBUFFERED=1 \
40
+ GRADIO_ALLOW_FLAGGING=never \
41
+ GRADIO_NUM_PORTS=1 \
42
+ GRADIO_SERVER_NAME=0.0.0.0 \
43
+ GRADIO_THEME=huggingface \
44
+ SYSTEM=spaces
45
+
46
+ WORKDIR $HOME/app
47
+
48
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
49
+ COPY --chown=user . $HOME/app
50
+
51
+ CMD ["python", "ingest.py"]