|
FROM ubuntu:20.04 |
|
|
|
ENV DEBIAN_FRONTEND=noninteractive |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
python3.8 \ |
|
python3.8-dev \ |
|
python3.8-distutils \ |
|
git \ |
|
wget \ |
|
curl \ |
|
build-essential \ |
|
libssl-dev \ |
|
libffi-dev \ |
|
libxml2-dev \ |
|
libxslt1-dev \ |
|
zlib1g-dev \ |
|
libsm6 \ |
|
libxext6 \ |
|
libxrender-dev \ |
|
libgl1-mesa-glx \ |
|
libglib2.0-0 \ |
|
libgomp1 \ |
|
ninja-build \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1 && \ |
|
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 |
|
|
|
|
|
RUN curl https://bootstrap.pypa.io/pip/3.8/get-pip.py -o get-pip.py && \ |
|
python get-pip.py && \ |
|
rm get-pip.py |
|
|
|
|
|
RUN python -m pip install --upgrade pip==23.0.1 setuptools==59.5.0 wheel cython |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
USER user |
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH |
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN pip install --user torch==1.9.0+cpu torchvision==0.10.0+cpu -f https://download.pytorch.org/whl/torch_stable.html |
|
|
|
|
|
RUN pip install --user numpy==1.21.6 |
|
|
|
|
|
RUN pip install --user \ |
|
Pillow==8.3.2 \ |
|
opencv-python==4.5.5.64 |
|
|
|
|
|
RUN pip install --user \ |
|
scipy==1.7.3 \ |
|
scikit-image==0.19.3 \ |
|
scikit-learn==1.0.2 |
|
|
|
|
|
RUN pip install --user detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.9/index.html |
|
|
|
|
|
RUN pip install --user pycocotools --no-build-isolation |
|
|
|
|
|
RUN pip install --user \ |
|
timm==0.4.12 \ |
|
einops==0.6.1 \ |
|
h5py==3.7.0 \ |
|
shapely==1.8.5 \ |
|
tqdm==4.64.1 \ |
|
imutils==0.5.4 |
|
|
|
|
|
RUN pip install --user \ |
|
httpx==0.23.0 \ |
|
httpcore==0.15.0 \ |
|
anyio==3.6.1 \ |
|
starlette==0.19.1 \ |
|
fastapi==0.78.0 \ |
|
uvicorn==0.18.2 |
|
|
|
|
|
|
|
RUN pip install --user \ |
|
huggingface_hub==0.17.3 \ |
|
gradio==3.50.2 |
|
|
|
|
|
RUN pip install --user natten==0.14.6 -f https://shi-labs.com/natten/wheels/cpu/torch1.9/index.html || \ |
|
echo "NATTEN installation failed - continuing without it" |
|
|
|
|
|
RUN pip install --user \ |
|
PyYAML==5.4.1 \ |
|
matplotlib==3.5.3 \ |
|
regex==2022.10.31 \ |
|
ftfy==6.1.1 \ |
|
wandb \ |
|
diffdist \ |
|
inflect==6.0.4 \ |
|
gdown==4.5.4 \ |
|
wget==3.2 |
|
|
|
|
|
COPY --chown=user:user . /app |
|
|
|
|
|
ENV CUDA_VISIBLE_DEVICES="" |
|
ENV FORCE_CUDA="0" |
|
ENV OMP_NUM_THREADS=4 |
|
ENV MKL_NUM_THREADS=4 |
|
ENV PYTHONUNBUFFERED=1 |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["python", "app.py"] |
|
|