Spaces:
Sleeping
Sleeping
| # Use Python 3.10 base | |
| FROM python:3.10-slim | |
| # set workdir | |
| WORKDIR /app | |
| # system deps (minimal) | |
| RUN apt-get update && apt-get install -y build-essential gcc --no-install-recommends \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # copy files | |
| COPY requirements.txt ./requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY . /app | |
| # If you want to train inside container uncomment next line: | |
| # RUN python train_model.py | |
| # Expose HF expected port 7860 | |
| EXPOSE 7860 | |
| # Run uvicorn on port 7860 (HF expects server on this port) | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] | |