| # Use a stable Python runtime as a parent image | |
| FROM python:3.9-buster | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Set an environment variable to tell Hugging Face where to cache models | |
| ENV HF_HOME /app/cache | |
| # NEW: Create the cache directory and make it writable by any user | |
| RUN mkdir -p /app/cache && chmod -R 777 /app/cache | |
| # Copy and install the Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the application code into the container | |
| COPY . . | |
| # The command to run your app | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |