FROM python:3.11-slim-bullseye # Install system dependencies, including build tools for py-cryptonight RUN sed -i 's/main/main contrib non-free/' /etc/apt/sources.list && \ apt-get update && \ apt-get install -y --no-install-recommends \ unrar \ libgl1 \ libglib2.0-0 \ build-essential \ python3-dev \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Upgrade pip and install core dependencies first RUN pip install --no-cache-dir --upgrade pip setuptools wheel packaging # Install CPU-only PyTorch first # Copy requirements and install with special handling COPY requirements.txt . RUN pip install --no-cache-dir \ -r requirements.txt \ --find-links https://download.pytorch.org/whl/cpu \ --extra-index-url https://pypi.org/simple && \ # Install remaining packages that might have been skipped pip install --no-cache-dir \ requests # Copy application code COPY . . # Create non-root user RUN useradd -m -u 1000 user && \ chown -R user:user /app USER user # Environment variables to suppress warnings ENV HF_HUB_DISABLE_PROGRESS=1 ENV TF_CPP_MIN_LOG_LEVEL=3 CMD ["python", "solo_miner.py"]