Update Dockerfile
Browse files- Dockerfile +21 -18
Dockerfile
CHANGED
|
@@ -1,28 +1,31 @@
|
|
| 1 |
-
FROM python:3.
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
| 4 |
build-essential \
|
| 5 |
-
|
| 6 |
-
git \
|
| 7 |
-
wget \
|
| 8 |
-
libgomp1 \
|
| 9 |
-
libopenblas-dev \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
-
|
|
|
|
| 13 |
|
| 14 |
-
|
| 15 |
-
RUN pip install --no-cache-dir
|
| 16 |
-
&& pip install --no-cache-dir -r /code/requirements.txt
|
| 17 |
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
|
|
|
|
| 25 |
EXPOSE 7860
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
WORKDIR /code
|
| 4 |
+
|
| 5 |
+
# Install minimal system dependencies
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
build-essential \
|
| 8 |
+
curl \
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
+
# Copy requirements first for better caching
|
| 12 |
+
COPY requirements.txt .
|
| 13 |
|
| 14 |
+
# Install Python dependencies
|
| 15 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 16 |
|
| 17 |
+
# Copy application
|
| 18 |
+
COPY app.py .
|
| 19 |
|
| 20 |
+
# Download model (will happen automatically at runtime)
|
| 21 |
+
# Or you can download it here if you want:
|
| 22 |
+
# RUN pip install huggingface-hub && \
|
| 23 |
+
# python -c "from huggingface_hub import hf_hub_download; \
|
| 24 |
+
# hf_hub_download(repo_id='bartowski/Phi-3.1-mini-4k-instruct-GGUF', \
|
| 25 |
+
# filename='Phi-3.1-mini-4k-instruct-IQ2_M.gguf', local_dir='/code')"
|
| 26 |
|
| 27 |
+
# Expose port
|
| 28 |
EXPOSE 7860
|
| 29 |
|
| 30 |
+
# Run the app
|
| 31 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
|