Create Dockerfile
Browse files- Dockerfile +32 -0
Dockerfile
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use slim Python base
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Install system dependencies
|
| 5 |
+
RUN apt-get update && \
|
| 6 |
+
apt-get install -y git build-essential cmake wget curl && \
|
| 7 |
+
rm -rf /var/lib/apt/lists/*
|
| 8 |
+
|
| 9 |
+
# Clone and build llama.cpp
|
| 10 |
+
RUN git clone https://github.com/ggml-org/llama.cpp.git /llama.cpp
|
| 11 |
+
WORKDIR /llama.cpp
|
| 12 |
+
RUN make
|
| 13 |
+
|
| 14 |
+
# Switch to app folder
|
| 15 |
+
WORKDIR /app
|
| 16 |
+
COPY app.py requirements.txt ./
|
| 17 |
+
|
| 18 |
+
# Make /app fully readable/writable/executable
|
| 19 |
+
RUN chmod -R 777 /app
|
| 20 |
+
|
| 21 |
+
# Install Python dependencies
|
| 22 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 23 |
+
|
| 24 |
+
# Download GGUF model at build time
|
| 25 |
+
RUN mkdir -p /app/model && \
|
| 26 |
+
wget -O /app/model/model.gguf "https://github.com/<username>/<repo>/raw/main/model.gguf"
|
| 27 |
+
|
| 28 |
+
# Expose port for Gradio
|
| 29 |
+
EXPOSE 7860
|
| 30 |
+
|
| 31 |
+
# Start app
|
| 32 |
+
CMD ["python", "app.py"]
|