Update Dockerfile
Browse files- Dockerfile +19 -3
Dockerfile
CHANGED
|
@@ -2,18 +2,34 @@ FROM python:3.10-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
curl \
|
|
|
|
|
|
|
|
|
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
COPY requirements.txt .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
|
| 12 |
-
COPY
|
| 13 |
|
| 14 |
EXPOSE 7860
|
| 15 |
|
| 16 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \
|
| 17 |
CMD curl -f http://localhost:7860/health || exit 1
|
| 18 |
|
| 19 |
-
CMD ["uvicorn",
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 6 |
+
PIP_NO_CACHE_DIR=1 \
|
| 7 |
+
HF_HOME=/data/.huggingface \
|
| 8 |
+
TRANSFORMERS_CACHE=/data/.huggingface \
|
| 9 |
+
XDG_CACHE_HOME=/data/.cache
|
| 10 |
+
|
| 11 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 12 |
curl \
|
| 13 |
+
git \
|
| 14 |
+
ca-certificates \
|
| 15 |
+
build-essential \
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
COPY requirements.txt .
|
| 19 |
+
|
| 20 |
+
RUN pip install --upgrade pip
|
| 21 |
+
|
| 22 |
+
# CUDA wheels para llama.cpp
|
| 23 |
+
RUN pip install \
|
| 24 |
+
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu124
|
| 25 |
+
|
| 26 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
|
| 28 |
+
COPY . .
|
| 29 |
|
| 30 |
EXPOSE 7860
|
| 31 |
|
| 32 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \
|
| 33 |
CMD curl -f http://localhost:7860/health || exit 1
|
| 34 |
|
| 35 |
+
CMD ["uvicorn","app:app","--host","0.0.0.0","--port","7860"]
|