Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +32 -0
Dockerfile
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.11
|
2 |
+
|
3 |
+
# Set up a new user named "user" with user ID 1000
|
4 |
+
RUN useradd -m -u 1000 user
|
5 |
+
|
6 |
+
# Switch to the "user" user
|
7 |
+
USER user
|
8 |
+
|
9 |
+
# Set home to the user's home directory
|
10 |
+
ENV HOME=/home/user \
|
11 |
+
PATH=/home/user/.local/bin:$PATH
|
12 |
+
|
13 |
+
WORKDIR $HOME/app
|
14 |
+
|
15 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
16 |
+
COPY --chown=user . $HOME/app
|
17 |
+
|
18 |
+
EXPOSE 7860
|
19 |
+
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
20 |
+
|
21 |
+
# Install the Hugging Face CLI tool
|
22 |
+
RUN pip install huggingface_hub==0.23.0
|
23 |
+
|
24 |
+
# Download your model using the Hugging Face CLI
|
25 |
+
RUN huggingface-cli download microsoft/Phi-3-mini-4k-instruct-gguf --local-dir ./models
|
26 |
+
|
27 |
+
# Install Python dependencies from requirements.txt
|
28 |
+
COPY requirements.txt .
|
29 |
+
RUN pip install -r requirements.txt
|
30 |
+
|
31 |
+
|
32 |
+
CMD ["python", "app.py"]
|