yinwentao commited on
Commit
87ae1de
·
1 Parent(s): 0d330e4

updateRequirements

Browse files
Files changed (1) hide show
  1. Dockerfile +43 -57
Dockerfile CHANGED
@@ -1,58 +1,44 @@
1
  FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu18.04
2
- ENV DEBIAN_FRONTEND=noninteractive
3
- RUN apt-get update && \
4
- apt-get upgrade -y && \
5
- apt-get install -y --no-install-recommends \
6
- git \
7
- zip \
8
- unzip \
9
- git-lfs \
10
- wget \
11
- curl \
12
- portaudio19-dev \
13
- # ffmpeg \
14
- ffmpeg \
15
- x264 \
16
- # python build dependencies \
17
- build-essential \
18
- libssl-dev \
19
- zlib1g-dev \
20
- libbz2-dev \
21
- libreadline-dev \
22
- libsqlite3-dev \
23
- libncursesw5-dev \
24
- xz-utils \
25
- tk-dev \
26
- libxml2-dev \
27
- libxmlsec1-dev \
28
- libffi-dev\
29
- liblzma-dev && \
30
- rm -rf /var/lib/apt/lists/*
31
-
32
-
33
- ENV HOME=/home \
34
- PATH=/home/.local/bin:${PATH}
35
- WORKDIR ${HOME}/app
36
-
37
- RUN curl https://pyenv.run | bash
38
- ENV PATH=${HOME}/.pyenv/shims:${HOME}/.pyenv/bin:${PATH}
39
- ENV PYTHON_VERSION=3.8.8
40
- RUN pyenv install ${PYTHON_VERSION} && \
41
- pyenv global ${PYTHON_VERSION} && \
42
- pyenv rehash && \
43
- pip install --no-cache-dir -U pip setuptools wheel
44
-
45
- RUN pip install --no-cache-dir -U torch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1
46
- COPY --chown=1000 requirements.txt /tmp/requirements.txt
47
- RUN pip install --no-cache-dir -U -r /tmp/requirements.txt
48
-
49
- COPY --chown=1000 . ${HOME}/app
50
- RUN ls -a
51
- ENV PYTHONPATH=${HOME}/app \
52
- PYTHONUNBUFFERED=1 \
53
- GRADIO_ALLOW_FLAGGING=never \
54
- GRADIO_NUM_PORTS=1 \
55
- GRADIO_SERVER_NAME=0.0.0.0 \
56
- GRADIO_THEME=huggingface \
57
- SYSTEM=spaces
58
- CMD ["python", "app.py"]
 
1
  FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu18.04
2
+
3
+ ARG DEBIAN_FRONTEND=noninteractive
4
+
5
+ ENV PYTHONUNBUFFERED=1
6
+
7
+ RUN apt-get update && apt-get install --no-install-recommends -y \
8
+ build-essential \
9
+ python3.8 \
10
+ python3-pip \
11
+ git \
12
+ ffmpeg \
13
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
14
+
15
+ WORKDIR /code
16
+
17
+ COPY ./requirements.txt /code/requirements.txt
18
+
19
+ # Set up a new user named "user" with user ID 1000
20
+ RUN useradd -m -u 1000 user
21
+ # Switch to the "user" user
22
+ USER user
23
+ # Set home to the user's home directory
24
+ ENV HOME=/home/user \
25
+ PATH=/home/user/.local/bin:$PATH \
26
+ PYTHONPATH=$HOME/app \
27
+ PYTHONUNBUFFERED=1 \
28
+ GRADIO_ALLOW_FLAGGING=never \
29
+ GRADIO_NUM_PORTS=1 \
30
+ GRADIO_SERVER_NAME=0.0.0.0 \
31
+ GRADIO_THEME=huggingface \
32
+ SYSTEM=spaces
33
+
34
+
35
+ RUN pip3 install --no-cache-dir -U torch==1.12.1 torchvision==0.13.1
36
+ RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
37
+
38
+ # Set the working directory to the user's home directory
39
+ WORKDIR $HOME/app
40
+
41
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
42
+ COPY --chown=user . $HOME/app
43
+
44
+ CMD ["python3", "app.py"]