GPU: - Switch Dockerfile base to pytorch/pytorch:2.3.1-cuda12.1-cudnn8-runtime - Add gpu_hasher.py: batched 2D DCT on GPU via PyTorch matrix multiply, 256 images/batch, produces imagehash-compatible 64-bit hex hashes, auto-falls back to CPU when CUDA unavailable - Replace per-image phash loop in scanner.py with phasher.hash_files() - docker-compose.yml: add nvidia GPU device reservation Hang fix: - takeout.is_takeout_folder() now caps at 50 directories (was walking entire tree — blocked for minutes on 65k+ file libraries) - Add "Not a Takeout folder" status message so takeout phase is never silent Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
18 lines
587 B
Docker
18 lines
587 B
Docker
# PyTorch + CUDA 12.1 base — matches Ubuntu 22.04 with NVIDIA driver 525+
|
|
FROM pytorch/pytorch:2.3.1-cuda12.1-cudnn8-runtime
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
libheif-dev libjpeg-dev libpng-dev libtiff-dev libwebp-dev \
|
|
libgl1 libglib2.0-0 exiftool ffmpeg \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
COPY app/ /app/
|
|
COPY templates/ /app/templates/
|
|
RUN mkdir -p /data /photos /app/static
|
|
|
|
EXPOSE 8000
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]
|