# CUDA + cudnn + PyTorch 2.5.1 (CUDA 12.4) FROM pytorch/pytorch:2.5.1-cuda12.4-cudnn9-devel # Sistema y build tools RUN apt-get update && apt-get install -y --no-install-recommends \ git openssh-client sshpass build-essential cmake ninja-build kmod curl ca-certificates && \ rm -rf /var/lib/apt/lists/* # CUDA env ENV CUDA_HOME=/usr/local/cuda ENV PATH=$CUDA_HOME/bin:$PATH ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH} # Evitar reinstall de torch/torchvision ya presentes y asegurar numpy RUN pip install --no-cache-dir -U pip && pip install --no-cache-dir numpy # Código app WORKDIR /app COPY . /app # Sistema y build tools (añade paquetes de Cairo) RUN apt-get update && apt-get install -y --no-install-recommends \ git openssh-client sshpass build-essential cmake ninja-build kmod \ pkg-config libcairo2-dev python3-dev libffi-dev \ && rm -rf /var/lib/apt/lists/* # Instalar el proyecto (usa pyproject del repo) RUN pip install --no-cache-dir -e . # Sustituir vLLM oficial por el fork de StarVector RUN git clone https://github.com/starvector/vllm.git /app/vllm && \ pip install --no-cache-dir -e /app/vllm # Crear usuario no root después de instalar dependencias RUN useradd -m -u 1000 user && chown -R user:user /app USER user # Permisos y arranque RUN chmod +x ./start.sh CMD ["./start.sh"]