| FROM nvidia/cuda:12.1.0-cudnn8-runtime-ubuntu22.04 |
|
|
| ENV DEBIAN_FRONTEND=noninteractive \ |
| PYTHONUNBUFFERED=1 \ |
| CUDA_HOME=/usr/local/cuda \ |
| PATH=/usr/local/cuda/bin:$PATH \ |
| LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH \ |
| TORCH_CUDA_ARCH_LIST="8.6" \ |
| NVIDIA_VISIBLE_DEVICES=all \ |
| NVIDIA_DRIVER_CAPABILITIES=all |
|
|
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| build-essential \ |
| python3-dev \ |
| python3-pip \ |
| git \ |
| ffmpeg \ |
| libsndfile1 \ |
| curl \ |
| && apt-get clean \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN ln -sf /usr/bin/python3 /usr/bin/python && \ |
| curl -sS https://bootstrap.pypa.io/get-pip.py | python3 && \ |
| python3 -m pip install --no-cache-dir pip==23.3.1 setuptools==69.0.3 wheel==0.42.0 |
|
|
| |
| RUN pip3 install --no-cache-dir torch==2.1.2 torchvision==0.16.2 --index-url https://download.pytorch.org/whl/cu121 |
|
|
| WORKDIR /app |
| RUN mkdir -p /app/cache /app/src && \ |
| chmod 777 /app/cache |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| RUN ln -sf /usr/bin/python3 /usr/bin/python && \ |
| curl -sS https://bootstrap.pypa.io/get-pip.py | python3 && \ |
| python3 -m pip install --no-cache-dir pip==23.3.1 setuptools==69.0.3 wheel==0.42.0 |
|
|
| |
| WORKDIR /app |
| RUN mkdir -p /app/cache /app/src && \ |
| chmod 777 /app/cache |
|
|
| |
| COPY requirements.txt /app/src/ |
| WORKDIR /app/src |
| RUN python3 -m pip install --no-cache-dir -r requirements.txt |
|
|
| |
| COPY . /app/src/ |
|
|
| |
| ENV MODEL_PATH=/app/cache \ |
| PYTHONPATH=/app/src:$PYTHONPATH \ |
| OMP_NUM_THREADS=1 \ |
| MKL_NUM_THREADS=1 |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| EXPOSE 8000 |
|
|
| CMD ["python", "server.py"] |