Vo Minh Vu
Update Dockerfile
b743811
FROM python:3.10-slim
# 1) Install CUDA runtime 11.7
RUN apt-get update && apt-get install -y gnupg curl && \
curl -s -L https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb \
-o cuda-keyring.deb && \
dpkg -i cuda-keyring.deb && \
apt-get update && \
apt-get install -y cuda-runtime-11-7 && \
rm -rf /var/lib/apt/lists/* cuda-keyring.deb
# install build/c runtime deps
RUN apt-get update && apt-get install -y \
build-essential python3-dev git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# create a cache dir for pip / torch / pooch / numba
ENV \
XDG_CACHE_HOME=/app/.cache \
PIP_CACHE_DIR=/app/.cache/pip \
TORCH_HOME=/app/.cache/torch \
HOME=/app \
NUMBA_CACHE_DIR=/app/.cache/numba \
NUMBA_DISABLE_CACHING=1
RUN mkdir -p /app/.cache/{pip,torch,numba} \
&& chmod -R 777 /app/.cache
# 2) install ALL your Python deps (including CPU-only torch)
COPY requirements.txt .
RUN pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
# 2) install torchmcubes (from Git or local wheel)
# Option A: from Git
# RUN pip install --no-cache-dir \
# git+https://github.com/tatsy/torchmcubes.git#egg=torchmcubes
# Option B: from a wheel directory in your repo
COPY wheel /wheel
RUN pip install --no-cache-dir /wheel/torchmcubes-*.whl
# copy and expose
COPY . .
EXPOSE 8000
CMD ["uvicorn","src.main:app","--host","0.0.0.0","--port","8000"]