| |
| FROM nvidia/cuda:12.1.0-cudnn8-runtime-ubuntu22.04 |
|
|
| |
| ENV PYTHONUNBUFFERED=1 \ |
| DEBIAN_FRONTEND=noninteractive \ |
| CUDA_HOME=/usr/local/cuda \ |
| PATH=/usr/local/cuda/bin:$PATH \ |
| LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| python3 \ |
| python3-pip \ |
| python3-dev \ |
| build-essential \ |
| curl \ |
| ffmpeg \ |
| libsndfile1 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel |
|
|
| |
| RUN pip3 install --no-cache-dir \ |
| torch==2.4.1 \ |
| torchaudio==2.4.1 \ |
| torchvision==0.19.1 \ |
| --extra-index-url https://download.pytorch.org/whl/cu121 |
|
|
| |
| WORKDIR /app |
|
|
| |
| COPY requirements.txt . |
|
|
| |
| RUN sed -i '/^torch==/d; /^torchaudio==/d; /^torchvision==/d; /^torchdata==/d' requirements.txt |
|
|
| |
| RUN pip3 install --no-cache-dir -r requirements.txt |
|
|
| |
| COPY . . |
|
|
| |
| RUN python3 -c "import torch; assert torch.cuda.is_available(), 'CUDA not available'" |
|
|
| |
| EXPOSE 8000 |
|
|
| |
| CMD ["python3", "server.py"] |