FROM python:3.11-slim # Install Tor and curl RUN apt-get update && apt-get install -y tor curl && rm -rf /var/lib/apt/lists/* # Create a writable Tor data directory RUN mkdir -p /tmp/tor # Copy tor configuration COPY torrc /etc/tor/torrc # Set workdir WORKDIR /app # Copy Python requirements and install COPY requirements.txt /app/requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Copy main script COPY app.py /app/app.py # Start Tor in background and then run app.py CMD tor & python app.py