FROM python:3.10-slim # Set working directory WORKDIR /app # Set environment variables for cache directories ENV HF_HOME=/tmp/.cache/huggingface ENV TRANSFORMERS_CACHE=/tmp/.cache/huggingface/transformers ENV TORCH_HOME=/tmp/.cache/torch ENV PYTHONPATH=/app # Install OpenMP RUN apt-get update && apt-get install -y libomp-dev # Install git RUN apt-get update && apt-get install -y --no-install-recommends git # Install compilers RUN apt update && apt install -y gcc g++ clang clang-tools cmake # Create cache directories with proper permissions RUN mkdir -p /tmp/.cache/huggingface/transformers && \ mkdir -p /tmp/.cache/torch && \ chmod -R 777 /tmp/.cache # Updating pip RUN pip install --upgrade pip # Install vllm cpu ENV VLLM_TARGET_DEVICE=cpu #ENV PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cpu #RUN pip install git+https://github.com/vllm-project/vllm.git # Copy requirements and install dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . # Make sure app files are readable RUN chmod -R 755 /app # Expose port EXPOSE 7860 # Run the application CMD ["python", "app.py"]