# Use an official Python runtime as a parent image FROM python:3.9 # Set the working directory in the container to /app WORKDIR /app # Create a cache directory and grant broad permissions RUN mkdir -p /app/cache RUN chmod -R 777 /app/cache # Set environment variable for Transformers cache ENV TRANSFORMERS_CACHE=/app/cache # Copy the requirements file into the container at /app COPY ./requirements.txt /app/requirements.txt # Install any needed packages specified in requirements.txt RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt # Copy the content of the local src directory to /app inside the container COPY . /app # Copy the jina directory into the container at /app/jina COPY ./jina /app/jina # Make port 7860 available to the world outside this container EXPOSE 7860 # Define the command to run the app using uvicorn CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]