# Use an official Python runtime as a base image FROM python:3.10 # Set environment variables ENV TRANSFORMERS_CACHE=/app/cache \ HF_HOME=/app/cache \ DEBIAN_FRONTEND=noninteractive \ CMAKE_ARGS="-DGGML_CUDA=OFF" # Set working directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ libgomp1 \ build-essential \ cmake \ && rm -rf /var/lib/apt/lists/* # Prepare cache directory RUN mkdir -p /app/cache && chmod -R 777 /app/cache # Copy requirements and install Python packages COPY requirements.txt . # Upgrade pip and install packages RUN pip install --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Copy application code and data COPY app.py cv_embeddings.json cv_text.txt ./ # Expose the port your FastAPI app runs on EXPOSE 7860 # Launch CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]