FROM python:3.11-slim WORKDIR /app COPY requirements.txt . # CPU-only torch wheel keeps the image small and is plenty fast for a # 1x64x64 grayscale input — no GPU needed. RUN pip install --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu COPY app.py . EXPOSE 7860 CMD ["python", "app.py"]