Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| # Install git package for our ai package, then clear cache to save docker space. | |
| RUN apt-get update && apt-get install -y git libgl1 libglib2.0-0 && rm -rf /var/lib/apt/lists/* | |
| # Working dir inside the container. | |
| WORKDIR /app | |
| RUN pip install --no-cache-dir --upgrade pip | |
| # Copies req.txt from local machine into /app inside container. | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the rest of files into /app folder. | |
| COPY . . | |
| # As HF want for backend. | |
| EXPOSE 7860 | |
| # 0.0.0.0 accepts connections from anywhere, not just local. also don't forget --ws to enable sockets on docker | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--ws", "websockets"] |