spacecx / Dockerfile
owlninjam's picture
Update Dockerfile
969b25e verified
# Dockerfile
FROM python:3.10-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
wget \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install llama-cpp-python from its prebuilt wheel index for CPU
RUN pip install --no-cache-dir \
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
llama-cpp-python==0.2.24
# Copy and install Python requirements
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Download the model file
RUN wget --progress=bar:force:noscroll -O capybarahermes-2.5-mistral-7b.Q5_K_M.gguf \
https://huggingface.co/TheBloke/CapybaraHermes-2.5-Mistral-7B-GGUF/resolve/main/capybarahermes-2.5-mistral-7b.Q5_K_M.gguf
# Copy the API application file
COPY api.py .
# Expose the port Hugging Face uses
EXPOSE 7860
# Command to run the Uvicorn server on the public port
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]