Spaces:
Runtime error
Runtime error
| # Use an official Python image | |
| FROM python:3.9-slim | |
| # Set environment variables | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV TRANSFORMERS_CACHE=/app/cache | |
| # Set work directory | |
| WORKDIR /app | |
| # Create cache directory | |
| RUN mkdir -p /app/cache | |
| # Copy the requirements file | |
| COPY requirements.txt . | |
| # Install dependencies | |
| RUN pip install --upgrade pip && pip install -r requirements.txt | |
| # Copy the app code | |
| COPY . . | |
| # Expose the port FastAPI will run on | |
| EXPOSE 8000 | |
| # Run the FastAPI app with uvicorn | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"] | |