# Start from a standard Python base image FROM python:3.9 # Set the working directory inside the container WORKDIR /code # --- ADD THIS LINE --- # Set the cache directory to a writable location inside the container ENV HF_HOME /code/cache # -------------------- # Copy the requirements file into the container COPY ./requirements.txt /code/requirements.txt # Install the Python dependencies RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt # Copy your application code into the container COPY ./app.py /code/app.py # Expose the port the app runs on EXPOSE 8000 # The command to run your FastAPI app using uvicorn CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]