Spaces:
Paused
Paused
| # Use NVIDIA CUDA base image with Ubuntu and Python support | |
| FROM nvidia/cuda:12.1.1-devel-ubuntu22.04 | |
| # Set working directory | |
| WORKDIR /app | |
| # Install Python and system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| python3.10 \ | |
| python3-pip \ | |
| python3.10-venv \ | |
| build-essential \ | |
| cmake \ | |
| git \ | |
| curl \ | |
| wget \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Use python3.10 as default | |
| RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 | |
| # Upgrade pip | |
| RUN pip install --upgrade pip | |
| # Set CUDA build flag for llama-cpp-python | |
| ENV CMAKE_ARGS="-DLLAMA_CUBLAS=on" | |
| # Copy requirements first for layer caching | |
| COPY requirements.txt . | |
| # Install dependencies (llama-cpp-python will compile with CUDA here) | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy app code | |
| COPY . . | |
| # Create models directory | |
| RUN mkdir -p models | |
| # Expose Gradio port | |
| EXPOSE 7860 | |
| # Environment for Gradio | |
| ENV GRADIO_SERVER_NAME="0.0.0.0" | |
| ENV GRADIO_SERVER_PORT=7860 | |
| # Run the app | |
| CMD ["python", "app.py"] | |