Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -3
Dockerfile
CHANGED
@@ -6,7 +6,17 @@ ENV MODEL=gguf/Smaug-34B-v0.1-GGUF
|
|
6 |
ENV QUANT=Q4_K_M
|
7 |
#ENV CHAT_TEMPLATE=chatml
|
8 |
|
9 |
-
# Set
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
WORKDIR $HOME/app
|
11 |
|
12 |
# Install Python requirements
|
@@ -17,8 +27,8 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
17 |
RUN MODEL_NAME_FILE=$(echo ${MODEL#*/} | tr '[:upper:]' '[:lower:]' | sed 's/-gguf$//') && \
|
18 |
wget https://huggingface.co/gguf/Smaug-34B-v0.1-GGUF/resolve/main/smaug-34b-v0.1.Q4_K_M.gguf -O model.gguf
|
19 |
|
20 |
-
# Copy the
|
21 |
-
COPY .
|
22 |
|
23 |
# Command to run the application
|
24 |
CMD ["python", "app.py"]
|
|
|
6 |
ENV QUANT=Q4_K_M
|
7 |
#ENV CHAT_TEMPLATE=chatml
|
8 |
|
9 |
+
# Set up a new user named "user" with user ID 1000
|
10 |
+
RUN useradd -m -u 1000 user
|
11 |
+
|
12 |
+
# Switch to the "user" user
|
13 |
+
USER user
|
14 |
+
|
15 |
+
# Set home to the user's home directory
|
16 |
+
ENV HOME=/home/user \
|
17 |
+
PATH=/home/user/.local/bin:$PATH
|
18 |
+
|
19 |
+
# Set the working directory to the user's home directory
|
20 |
WORKDIR $HOME/app
|
21 |
|
22 |
# Install Python requirements
|
|
|
27 |
RUN MODEL_NAME_FILE=$(echo ${MODEL#*/} | tr '[:upper:]' '[:lower:]' | sed 's/-gguf$//') && \
|
28 |
wget https://huggingface.co/gguf/Smaug-34B-v0.1-GGUF/resolve/main/smaug-34b-v0.1.Q4_K_M.gguf -O model.gguf
|
29 |
|
30 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
31 |
+
COPY --chown=user . $HOME/app
|
32 |
|
33 |
# Command to run the application
|
34 |
CMD ["python", "app.py"]
|