| |
| |
|
|
| FROM python:3.11-slim |
|
|
| |
| ENV PYTHONUNBUFFERED=1 \ |
| PYTHONDONTWRITEBYTECODE=1 \ |
| SACCP_HEAD_URL="https://bc-ai-saccp-head.hf.space" \ |
| SACCP_NODE_TYPE="CPU" \ |
| SACCP_NODE_OWNER="anonymous" \ |
| SACCP_AUTO_REGISTER="true" \ |
| SPACE_HOST="https://bc-ai-node-test.hf.space" \ |
| PORT=7860 |
|
|
| |
| RUN useradd -m -u 1000 user |
| WORKDIR /home/user/app |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| gcc \ |
| curl \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY requirements.txt . |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| COPY app.py . |
|
|
| |
| RUN chown -R user:user /home/user/app |
|
|
| |
| USER user |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=10s --retries=3 \ |
| CMD curl -f http://localhost:7860/health || exit 1 |
|
|
| |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |