Update Dockerfile
Browse files- Dockerfile +9 -7
Dockerfile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
# Usamos una imagen de Python ligera y estable
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# 1. Instalar herramientas
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
build-essential \
|
| 7 |
gcc \
|
|
@@ -15,16 +15,18 @@ ENV HOME=/home/user \
|
|
| 15 |
PATH=/home/user/.local/bin:$PATH
|
| 16 |
WORKDIR $HOME/app
|
| 17 |
|
| 18 |
-
# 3. Copiar
|
| 19 |
COPY --chown=user requirements.txt .
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
|
| 22 |
|
| 23 |
-
#
|
| 24 |
COPY --chown=user . .
|
| 25 |
|
| 26 |
-
#
|
| 27 |
EXPOSE 7860
|
| 28 |
-
|
| 29 |
-
# 6. Iniciar la aplicaci贸n usando Uvicorn (optimizando workers)
|
| 30 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
# Usamos una imagen de Python ligera y estable
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# 1. Instalar herramientas base
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
build-essential \
|
| 7 |
gcc \
|
|
|
|
| 15 |
PATH=/home/user/.local/bin:$PATH
|
| 16 |
WORKDIR $HOME/app
|
| 17 |
|
| 18 |
+
# 3. Copiar dependencias
|
| 19 |
COPY --chown=user requirements.txt .
|
| 20 |
+
|
| 21 |
+
# 4. TRUCO ANTI-TIMEOUT: Instalar llama-cpp-python pre-compilado para CPU
|
| 22 |
+
RUN pip install --no-cache-dir llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 23 |
+
|
| 24 |
+
# 5. Instalar el resto de dependencias r谩pidamente
|
| 25 |
RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
|
| 26 |
|
| 27 |
+
# 6. Copiar el resto de tu c贸digo
|
| 28 |
COPY --chown=user . .
|
| 29 |
|
| 30 |
+
# 7. Exponer puerto y arrancar Uvicorn
|
| 31 |
EXPOSE 7860
|
|
|
|
|
|
|
| 32 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|