# SharePUTER Worker Node — Docker Image for HF Spaces / Serverless Deployment # Supports RAM, CPU, and GPU node types FROM python:3.11-slim # Set environment variables 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 # Create non-root user (HF Spaces requirement) RUN useradd -m -u 1000 user WORKDIR /home/user/app # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ curl \ && rm -rf /var/lib/apt/lists/* # Install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application COPY app.py . # Change ownership RUN chown -R user:user /home/user/app # Switch to non-root user USER user # Expose port EXPOSE 7860 # Health check HEALTHCHECK --interval=30s --timeout=10s --retries=3 \ CMD curl -f http://localhost:7860/health || exit 1 # Run the worker node CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]