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