# Use an official Python runtime as a parent image # FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8 FROM python:3.9 # Set the working directory in the container to /app WORKDIR /app # Create a directory for the transformers cache RUN mkdir -p /transformers_cache # Set the environment variable for transformers cache ENV TRANSFORMERS_CACHE=/transformers_cache # Copy the current directory contents into the container at /app COPY . /app # Install any needed packages specified in requirements.txt RUN pip install --trusted-host pypi.python.org fastapi[all] uvicorn langchain sentence_transformers faiss-cpu ctransformers # Run the command to start uvicorn CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]