English / Dockerfile
Lachowskii's picture
Update Dockerfile
1ec1b7d verified
Raw
History Blame Contribute Delete
713 Bytes
FROM python:3.10
# Minimal system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir --upgrade pip
# Install regular dependencies
RUN pip install --no-cache-dir \
fastapi \
uvicorn \
huggingface_hub \
pydantic
# Install PRE-COMPILED llama-cpp-python for CPU
# This prevents the "Job timeout" by skipping the build phase
RUN pip install llama-cpp-python \
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
# Set working directory
WORKDIR /app
# Copy your application code
COPY app.py .
# Run the API
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]