Spaces:
Sleeping
Sleeping
File size: 919 Bytes
60967d1 3ec3a80 b6afb39 3ec3a80 60967d1 3ec3a80 60967d1 3ec3a80 60967d1 3ec3a80 60967d1 3ec3a80 60967d1 3ec3a80 60967d1 3ec3a80 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
FROM python:3.12-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc g++ cmake build-essential curl git \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHON_VERSION=3.12.4 \
HF_HOME=/data/.cache/huggingface \
PATH="/root/.local/bin:$PATH"
# Set working directory
WORKDIR /app
# Ensure Hugging Face cache is writable
RUN mkdir -p /data/.cache/huggingface && \
chmod -R 777 /data
# Copy requirements and install them
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install llama-cpp-python==0.2.72 && \
pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY . .
# Expose FastAPI port
EXPOSE 7860
# Run FastAPI app using uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|