|
|
|
|
|
FROM tensorflow/tensorflow:2.4.2-gpu |
|
|
|
|
|
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub |
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common \ |
|
libsm6 libxext6 libxrender-dev curl \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
RUN echo "**** Installing Python ****" && \ |
|
add-apt-repository ppa:deadsnakes/ppa && \ |
|
apt-get install -y build-essential python3.7 python3.7-dev python3-pip && \ |
|
curl -O https://bootstrap.pypa.io/get-pip.py && \ |
|
python3.7 get-pip.py && \ |
|
rm -rf /var/lib/apt/lists/* |
|
|
|
WORKDIR /code |
|
|
|
RUN apt-get update -y |
|
RUN apt install git --fix-missing -y |
|
|
|
|
|
COPY ./demo/requirements.txt /code/demo/requirements.txt |
|
RUN python3.7 -m pip install --no-cache-dir --upgrade -r /code/demo/requirements.txt |
|
|
|
|
|
RUN python3.7 -m pip install --force-reinstall typing_extensions==4.0.0 |
|
|
|
|
|
RUN apt install wget -y |
|
|
|
RUN ls -la |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
|
|
USER user |
|
|
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH |
|
|
|
|
|
WORKDIR $HOME/app |
|
|
|
|
|
COPY --chown=user . $HOME/app |
|
|
|
|
|
RUN wget "https://github.com/andreped/livermask/releases/download/trained-models-v1/model.h5" |
|
|
|
CMD ["python3.7", "demo/app.py"] |
|
|