Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +24 -8
Dockerfile
CHANGED
@@ -1,25 +1,41 @@
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
-
# Install system dependencies
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
ffmpeg \
|
6 |
git \
|
7 |
curl \
|
8 |
-
|
9 |
-
|
|
|
|
|
10 |
|
11 |
-
# Set
|
12 |
WORKDIR /app
|
13 |
|
14 |
-
# Copy files
|
15 |
COPY . /app
|
16 |
|
17 |
# Install Python dependencies
|
18 |
RUN pip install --upgrade pip \
|
19 |
-
&& pip install -r requirements.txt
|
|
|
20 |
|
21 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
EXPOSE 7860
|
23 |
|
24 |
-
#
|
25 |
CMD ["python", "app.py"]
|
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
+
# Install system dependencies and build tools
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
ffmpeg \
|
6 |
git \
|
7 |
curl \
|
8 |
+
build-essential \
|
9 |
+
cmake \
|
10 |
+
libgomp1 \
|
11 |
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
+
# Set working directory
|
14 |
WORKDIR /app
|
15 |
|
16 |
+
# Copy application files
|
17 |
COPY . /app
|
18 |
|
19 |
# Install Python dependencies
|
20 |
RUN pip install --upgrade pip \
|
21 |
+
&& pip install -r requirements.txt \
|
22 |
+
&& pip install huggingface_hub
|
23 |
|
24 |
+
# Download GGUF model at build time into models/
|
25 |
+
RUN mkdir -p models \
|
26 |
+
&& python - <<EOF
|
27 |
+
from huggingface_hub import hf_hub_download
|
28 |
+
hf_hub_download(
|
29 |
+
repo_id="TheBloke/Mistral-7B-Instruct-GPTQ",
|
30 |
+
filename="mistral-7b-instruct-q4_k_m.gguf",
|
31 |
+
cache_dir="models",
|
32 |
+
library_name="llama-cpp-python"
|
33 |
+
)
|
34 |
+
EOF
|
35 |
+
|
36 |
+
# Expose port 7860 for Flask app
|
37 |
EXPOSE 7860
|
38 |
|
39 |
+
# Start the Flask application
|
40 |
CMD ["python", "app.py"]
|
41 |
+
```
|