From c234193eb42eba1724da3314cf41767123478e86 Mon Sep 17 00:00:00 2001 From: denis Date: Wed, 23 Sep 2026 01:37:36 +0300 Subject: [PATCH] develop - hack_2026 --- Dockerfile_cuda | 52 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/Dockerfile_cuda b/Dockerfile_cuda index b153d07..8ebb20e 100644 --- a/Dockerfile_cuda +++ b/Dockerfile_cuda @@ -1,13 +1,18 @@ -# DXA Quality Assessment - Docker Container +# DXA Quality Assessment - Docker Container (GPU / CUDA) # Build: docker build -t dxa-quality . -# Run: docker run -v /path/to/data:/data -p 8000:8000 dxa-quality +# Run: docker run --gpus all -v /path/to/data:/data -p 8000:8000 dxa-quality # Base image with GPU support -FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 AS builder +FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 + +# Неинтерактивный режим для apt +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y \ python3.10 \ python3-pip \ + python3.10-dev \ + python3.10-venv \ build-essential \ ninja-build \ libgl1-mesa-glx \ @@ -18,13 +23,44 @@ RUN apt-get update && apt-get install -y \ libgomp1 \ && rm -rf /var/lib/apt/lists/* -# Установить свежий meson через pip (0.64.0+) -RUN pip3 install --no-cache-dir "meson>=0.64.0" +# Обновляем pip и ставим свежий meson (0.64.0+) — ДО всех Python-пакетов +RUN pip3 install --no-cache-dir --upgrade pip "meson>=0.64.0" WORKDIR /app -COPY requirements.txt . -RUN pip3 install --no-cache-dir -r requirements.txt +# --- PyTorch под CUDA 11.8 (ставим отдельно, чтобы не тянулся CUDA 12.6) --- +RUN pip3 install --no-cache-dir \ + torch==2.8.0 torchvision==0.23.0 \ + --index-url https://download.pytorch.org/whl/cu118 + +# --- Остальные зависимости --- +# Ставим с явными ограничениями, чтобы pip разрешил конфликты +RUN pip3 install --no-cache-dir \ + fastapi==0.128.8 \ + "uvicorn[standard]==0.39.0" \ + monai==1.5.2 \ + TotalSegmentator==2.18.0 \ + nibabel==5.3.3 \ + pydicom==2.4.4 \ + pydicom-seg==0.4.1 \ + opencv-python-headless==4.11.0.86 \ + scikit-learn==1.6.1 \ + scipy==1.13.1 \ + pandas==2.3.3 \ + numpy==1.26.4 \ + openpyxl==3.1.5 \ + matplotlib==3.9.4 \ + timm==1.0.29 \ + python-multipart==0.0.20 \ + pydantic==2.13.4 \ + typer==0.23.2 \ + click==8.2.1 \ + huggingface_hub==1.8.0 \ + safetensors==0.7.0 \ + simpleitk==2.5.6 \ + tqdm==4.70.0 \ + rich==15.0.0 \ + PyYAML==6.0.3 # Copy application code COPY . . @@ -38,4 +74,4 @@ ENV PYTHONUNBUFFERED=1 ENV PYTHONPATH=/app # Default command -CMD ["python3", "-m", "uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000"] +CMD ["python3", "-m", "uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file