Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +21 -0
Dockerfile
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
# Run as `docker run -it --mount src="$HOME/.cache",target=/root/.cache,type=bind --gpus=all localgpt`, requires Nvidia container toolkit.
|
4 |
FROM nvidia/cuda:11.7.1-runtime-ubuntu22.04
|
5 |
|
|
|
|
|
6 |
RUN apt-get update && apt-get upgrade -y \
|
7 |
&& apt-get install -y git build-essential libpq-dev gcc \
|
8 |
wget ocl-icd-opencl-dev opencl-headers clinfo \
|
@@ -24,6 +26,25 @@ RUN python -m pip install --upgrade pip pytest cmake \
|
|
24 |
scikit-build setuptools fastapi uvicorn sse-starlette \
|
25 |
pydantic-settings starlette-context gradio huggingface_hub hf_transfer
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
RUN chmod +x ./run.sh
|
28 |
|
29 |
CMD ./run.sh
|
|
|
3 |
# Run as `docker run -it --mount src="$HOME/.cache",target=/root/.cache,type=bind --gpus=all localgpt`, requires Nvidia container toolkit.
|
4 |
FROM nvidia/cuda:11.7.1-runtime-ubuntu22.04
|
5 |
|
6 |
+
ENV HOST 0.0.0.0
|
7 |
+
|
8 |
RUN apt-get update && apt-get upgrade -y \
|
9 |
&& apt-get install -y git build-essential libpq-dev gcc \
|
10 |
wget ocl-icd-opencl-dev opencl-headers clinfo \
|
|
|
26 |
scikit-build setuptools fastapi uvicorn sse-starlette \
|
27 |
pydantic-settings starlette-context gradio huggingface_hub hf_transfer
|
28 |
|
29 |
+
RUN useradd -m -u 1000 user
|
30 |
+
# Switch to the "user" user
|
31 |
+
USER user
|
32 |
+
# Set home to the user's home directory
|
33 |
+
ENV HOME=/home/user \
|
34 |
+
PATH=/home/user/.local/bin:$PATH \
|
35 |
+
PYTHONPATH=$HOME/app \
|
36 |
+
PYTHONUNBUFFERED=1 \
|
37 |
+
GRADIO_ALLOW_FLAGGING=never \
|
38 |
+
GRADIO_NUM_PORTS=1 \
|
39 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
40 |
+
GRADIO_THEME=huggingface \
|
41 |
+
SYSTEM=spaces
|
42 |
+
|
43 |
+
WORKDIR $HOME/app
|
44 |
+
|
45 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
46 |
+
COPY --chown=user . $HOME/app
|
47 |
+
|
48 |
RUN chmod +x ./run.sh
|
49 |
|
50 |
CMD ./run.sh
|