Spaces:
Running
Running
| # Use an official Python runtime as a parent image | |
| FROM python:3.10 | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Set the cache directory for Hugging Face to a writable location | |
| ENV HF_HOME /app/.cache/huggingface | |
| # Create the cache directory and set permissions | |
| RUN mkdir -p /app/.cache && chmod 777 /app/.cache | |
| # Copy the requirements file into the container | |
| COPY requirements.txt . | |
| # Install the dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the application code into the container | |
| COPY . . | |
| # Expose the port your FastAPI app will run on | |
| EXPOSE 7860 | |
| # Command to run the application using Uvicorn | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |