diff --git a/Dockerfile b/Dockerfile index effe50c..eb81a6f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,40 +1,33 @@ -# DXA Quality Assessment - Docker Container +# DXA Quality Assessment - Docker Container (CPU only) # Build: docker build -t dxa-quality . # Run: docker run -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 python:3.10-slim AS builder -# Install Python and build tools RUN apt-get update && apt-get install -y \ - python3.10 \ - python3-pip \ build-essential \ - meson \ ninja-build \ - libgl1-mesa-glx \ + libgl1 \ libglib2.0-0 \ libsm6 \ libxext6 \ libxrender1 \ libgomp1 \ && rm -rf /var/lib/apt/lists/* + +RUN pip3 install --no-cache-dir "meson>=0.64.0" + WORKDIR /app -# Copy requirements and install Python dependencies COPY requirements.txt . -RUN pip3 install --no-cache-dir -r requirements.txt +RUN pip3 install --no-cache-dir -r requirements.txt -# Copy application code COPY . . RUN mkdir -p models -# Expose API port EXPOSE 8000 -# Environment variables 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 diff --git a/Dockerfile_cuda b/Dockerfile_cuda new file mode 100644 index 0000000..b153d07 --- /dev/null +++ b/Dockerfile_cuda @@ -0,0 +1,41 @@ +# DXA Quality Assessment - Docker Container +# Build: docker build -t dxa-quality . +# Run: docker run -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 + +RUN apt-get update && apt-get install -y \ + python3.10 \ + python3-pip \ + build-essential \ + ninja-build \ + libgl1-mesa-glx \ + libglib2.0-0 \ + libsm6 \ + libxext6 \ + libxrender1 \ + libgomp1 \ + && rm -rf /var/lib/apt/lists/* + +# Установить свежий meson через pip (0.64.0+) +RUN pip3 install --no-cache-dir "meson>=0.64.0" + +WORKDIR /app +COPY requirements.txt . +RUN pip3 install --no-cache-dir -r requirements.txt + + +# Copy application code +COPY . . +RUN mkdir -p models + +# Expose API port +EXPOSE 8000 + +# Environment variables +ENV PYTHONUNBUFFERED=1 +ENV PYTHONPATH=/app + +# Default command +CMD ["python3", "-m", "uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000"]