# Use the official Python 3.9 image as base FROM python:3.9 # Set the working directory to /code WORKDIR /code # Copy the requirements file into the container at /code COPY requirements.txt /code/ # Install the requirements RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt # Create a directory for the Hugging Face cache and set permissions RUN mkdir -p /code/cache && chmod -R 777 /code/cache # Set the TRANSFORMERS_CACHE environment variable to the new cache directory ENV TRANSFORMERS_CACHE=/code/cache # Copy the current directory contents into the container at /code COPY . /code # Start the FastAPI app on port 8100 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8100"]