Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +16 -13
Dockerfile
CHANGED
|
@@ -29,36 +29,39 @@
|
|
| 29 |
# CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
|
| 30 |
|
| 31 |
|
| 32 |
-
|
| 33 |
FROM python:3.11-slim
|
| 34 |
|
| 35 |
# System dependencies
|
| 36 |
RUN apt-get update && apt-get install -y \
|
| 37 |
gcc \
|
| 38 |
g++ \
|
| 39 |
-
|
|
|
|
| 40 |
&& rm -rf /var/lib/apt/lists/*
|
| 41 |
|
| 42 |
WORKDIR /app
|
| 43 |
|
| 44 |
-
# Install llama-cpp-python
|
|
|
|
| 45 |
RUN pip install --no-cache-dir \
|
| 46 |
-
llama-cpp-python==0.2.90 \
|
| 47 |
-
--
|
| 48 |
-
--
|
| 49 |
|
| 50 |
-
#
|
| 51 |
-
|
|
|
|
|
|
|
| 52 |
|
| 53 |
-
|
| 54 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 55 |
|
| 56 |
-
# Copy
|
| 57 |
COPY app/ ./app/
|
| 58 |
|
| 59 |
-
#
|
| 60 |
-
RUN mkdir -p /
|
| 61 |
|
| 62 |
EXPOSE 7860
|
| 63 |
|
| 64 |
-
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 29 |
# CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
|
| 30 |
|
| 31 |
|
|
|
|
| 32 |
FROM python:3.11-slim
|
| 33 |
|
| 34 |
# System dependencies
|
| 35 |
RUN apt-get update && apt-get install -y \
|
| 36 |
gcc \
|
| 37 |
g++ \
|
| 38 |
+
cmake \
|
| 39 |
+
libgomp1 \
|
| 40 |
&& rm -rf /var/lib/apt/lists/*
|
| 41 |
|
| 42 |
WORKDIR /app
|
| 43 |
|
| 44 |
+
# Install llama-cpp-python kutoka PyPI moja kwa moja (glibc compatible)
|
| 45 |
+
# --prefer-binary inachukua pre-built wheel ya glibc, si musl
|
| 46 |
RUN pip install --no-cache-dir \
|
| 47 |
+
"llama-cpp-python==0.2.90" \
|
| 48 |
+
--prefer-binary \
|
| 49 |
+
--no-deps
|
| 50 |
|
| 51 |
+
# Install dependencies zingine
|
| 52 |
+
RUN pip install --no-cache-dir \
|
| 53 |
+
diskcache \
|
| 54 |
+
numpy
|
| 55 |
|
| 56 |
+
COPY requirements.txt .
|
| 57 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 58 |
|
| 59 |
+
# Copy code
|
| 60 |
COPY app/ ./app/
|
| 61 |
|
| 62 |
+
# Tengeneza folders
|
| 63 |
+
RUN mkdir -p ./data ./models
|
| 64 |
|
| 65 |
EXPOSE 7860
|
| 66 |
|
| 67 |
+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
|