Fixed Dockerfile
Browse files- demo/.dockerignore +1 -0
- demo/Dockerfile +23 -5
demo/.dockerignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
flagged/
|
demo/Dockerfile
CHANGED
|
@@ -1,16 +1,34 @@
|
|
| 1 |
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
| 2 |
# you will also find guides on how best to write your Dockerfile
|
| 3 |
|
| 4 |
-
FROM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
WORKDIR /code
|
| 7 |
|
|
|
|
|
|
|
|
|
|
| 8 |
# install dependencies
|
| 9 |
COPY ./requirements.txt /code/requirements.txt
|
| 10 |
-
RUN python3 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 11 |
|
| 12 |
-
# resolve issue with tf==2.4 and gradio
|
| 13 |
-
RUN python3 -m pip install --force-reinstall typing_extensions==4.0.0
|
| 14 |
|
| 15 |
# Set up a new user named "user" with user ID 1000
|
| 16 |
RUN useradd -m -u 1000 user
|
|
@@ -28,4 +46,4 @@ WORKDIR $HOME/app
|
|
| 28 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 29 |
COPY --chown=user . $HOME/app
|
| 30 |
|
| 31 |
-
CMD ["python3", "app.py"]
|
|
|
|
| 1 |
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
| 2 |
# you will also find guides on how best to write your Dockerfile
|
| 3 |
|
| 4 |
+
FROM tensorflow/tensorflow:2.4.2-gpu
|
| 5 |
+
|
| 6 |
+
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
|
| 7 |
+
|
| 8 |
+
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common \
|
| 9 |
+
libsm6 libxext6 libxrender-dev curl \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
+
|
| 12 |
+
RUN echo "**** Installing Python ****" && \
|
| 13 |
+
add-apt-repository ppa:deadsnakes/ppa && \
|
| 14 |
+
apt-get install -y build-essential python3.7 python3.7-dev python3-pip && \
|
| 15 |
+
curl -O https://bootstrap.pypa.io/get-pip.py && \
|
| 16 |
+
python3.7 get-pip.py && \
|
| 17 |
+
rm -rf /var/lib/apt/lists/*
|
| 18 |
+
|
| 19 |
+
RUN alias python="/usr/bin/python3.7"
|
| 20 |
|
| 21 |
WORKDIR /code
|
| 22 |
|
| 23 |
+
RUN apt-get update -y
|
| 24 |
+
RUN apt install git --fix-missing -y
|
| 25 |
+
|
| 26 |
# install dependencies
|
| 27 |
COPY ./requirements.txt /code/requirements.txt
|
| 28 |
+
RUN python3.7 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 29 |
|
| 30 |
+
# resolve issue with tf==2.4 and gradio dependency collision issue
|
| 31 |
+
RUN python3.7 -m pip install --force-reinstall typing_extensions==4.0.0
|
| 32 |
|
| 33 |
# Set up a new user named "user" with user ID 1000
|
| 34 |
RUN useradd -m -u 1000 user
|
|
|
|
| 46 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 47 |
COPY --chown=user . $HOME/app
|
| 48 |
|
| 49 |
+
CMD ["python3.7", "app.py"]
|