Miroslav Purkrabek commited on
Commit
3275859
·
1 Parent(s): 1e7ea0d

update dockerfile by template

Browse files
Files changed (1) hide show
  1. Dockerfile +36 -53
Dockerfile CHANGED
@@ -1,61 +1,44 @@
1
- FROM nvidia/cuda:12.1.0-devel-ubuntu22.04
2
-
3
- # Set up non-interactive installation
4
- ENV DEBIAN_FRONTEND=noninteractive
5
-
6
- # Set up timezone
7
- RUN apt-get update && apt-get install -y --no-install-recommends \
8
- tzdata \
9
- && ln -fs /usr/share/zoneinfo/UTC /etc/localtime \
10
- && dpkg-reconfigure --frontend noninteractive tzdata
11
-
12
- # Install system dependencies
13
- RUN apt-get update && apt-get install -y --no-install-recommends \
14
- build-essential \
15
- ca-certificates \
16
- cmake \
17
- curl \
18
- ffmpeg \
19
- git \
20
- libglib2.0-0 \
21
- libsm6 \
22
- libxext6 \
23
- libxrender-dev \
24
- python3 \
25
- python3-dev \
26
- python3-pip \
27
- wget \
28
- && rm -rf /var/lib/apt/lists/*
29
-
30
- # Create symbolic link for python
31
- RUN ln -sf /usr/bin/python3 /usr/bin/python
32
-
33
- # Upgrade pip
34
- RUN python -m pip install --no-cache-dir --upgrade pip
35
-
36
- # Set working directory
37
- WORKDIR /app
38
-
39
- # Copy the repository content
40
- COPY . /app/
41
-
42
- # Following the setup.sh script step by step
43
 
44
  # Install torch, torchvision, OpenCV and NumPy with versions as specified
45
- RUN pip install --no-cache-dir torch==2.1.2+cu121 torchvision==0.16.2+cu121 --extra-index-url https://download.pytorch.org/whl/cu121
46
 
47
  # Install MMLibrary
48
- RUN pip install --no-cache-dir -U openmim
49
  RUN mim install --no-cache-dir mmengine "mmcv==2.1.0" "mmdet==3.3.0" "mmpretrain==1.2.0"
50
- RUN pip install --no-cache-dir numpy==1.25.1 opencv-python==4.9.0.80
51
-
52
- # Install other dependencies from requirements
53
- RUN pip install --no-cache-dir -r requirements_manual.txt
54
-
55
- RUN pip install --no-cache-dir numpy==1.25.1 opencv-python==4.9.0.80
56
-
57
- # Install the package itself in development mode
58
- RUN pip install --no-cache-dir -e .
59
 
60
  # Set the working directory to the user's home directory
61
  WORKDIR $HOME/app
 
1
+ FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.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.9 \
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_manual.txt /code/requirements_manual.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
  # Install torch, torchvision, OpenCV and NumPy with versions as specified
35
+ RUN pip3 install --no-cache-dir torch==2.1.2+cu121 torchvision==0.16.2+cu121 --extra-index-url https://download.pytorch.org/whl/cu121
36
 
37
  # Install MMLibrary
38
+ RUN pip3 install --no-cache-dir -U openmim
39
  RUN mim install --no-cache-dir mmengine "mmcv==2.1.0" "mmdet==3.3.0" "mmpretrain==1.2.0"
40
+ RUN pip3 install --no-cache-dir numpy==1.25.1 opencv-python==4.9.0.80
41
+ RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
 
 
 
 
 
42
 
43
  # Set the working directory to the user's home directory
44
  WORKDIR $HOME/app