Spaces:
Sleeping
Sleeping
| # Use an official Python base image | |
| FROM python:3.10 | |
| # Set the working directory | |
| WORKDIR /app | |
| # Set environment variables for HF cache | |
| ENV HF_HOME="/app/cache" | |
| ENV TRANSFORMERS_CACHE="/app/cache" | |
| ENV SENTENCE_TRANSFORMERS_HOME="/app/cache" | |
| # Create the cache directory with appropriate permissions | |
| RUN mkdir -p /app/cache && chmod -R 777 /app/cache | |
| # Copy the requirements file and install dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the application code | |
| COPY . . | |
| # Expose the FastAPI default port | |
| EXPOSE 8000 | |
| # Run FastAPI with Uvicorn | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] | |