Download Dockerfile from Iodevsho/Mega-DL: direct link, hf CLI and curl.
- Browser
- Download file 916 Bytes
-
https://huggingface.co/spaces/Iodevsho/Mega-DL/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Iodevsho/Mega-DL/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Iodevsho/Mega-DL/resolve/main/Dockerfile
916 Bytes
| # Use slim python base image | |
| FROM python:3.11-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies + Tor | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| tor \ | |
| build-essential && \ | |
| apt-get clean && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Generate Tor control password hash (SAFE & CORRECT) | |
| RUN tor --hash-password torpass | grep "^16:" > /tmp/torpass.hash | |
| # Write Tor configuration | |
| RUN echo "SocksPort 9050\n\ | |
| ControlPort 9051\n\ | |
| CookieAuthentication 0\n\ | |
| HashedControlPassword $(cat /tmp/torpass.hash)\n\ | |
| NewCircuitPeriod 15\n" > /etc/tor/torrc | |
| # Copy requirements first (better caching) | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy project files | |
| COPY . . | |
| # Expose API port | |
| EXPOSE 7860 | |
| # Start Tor in background, then FastAPI | |
| CMD tor & uvicorn main:app --host 0.0.0.0 --port 7860 | |