Gabriel commited on
Commit
77ea1cf
1 Parent(s): 95803a5

updated dockerfile

Browse files
Files changed (2) hide show
  1. Dockerfile +25 -10
  2. requirements.txt +1 -1
Dockerfile CHANGED
@@ -1,4 +1,17 @@
1
- FROM python:3.10
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  WORKDIR /code
4
 
@@ -6,9 +19,6 @@ COPY ./requirements.txt /code/requirements.txt
6
 
7
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
 
9
- RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
10
- #RUN apt-get update && apt-get install -y git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx \
11
-
12
  # mim openmmlabs installs (quick fix..)
13
  RUN mim install mmengine
14
  RUN mim install mmcv
@@ -17,15 +27,20 @@ RUN mim install mmocr
17
 
18
  # Set up a new user named "user" with user ID 1000
19
  RUN useradd -m -u 1000 user
 
20
  # Switch to the "user" user
21
  USER user
22
 
23
- # for localrun
24
- ENV AM_I_IN_A_DOCKER_CONTAINER Yes
25
-
26
- # Set home to the user's home directory
27
  ENV HOME=/home/user \
28
- PATH=/home/user/.local/bin:$PATH
 
 
 
 
 
 
 
 
29
 
30
  # Set the working directory to the user's home directory
31
  WORKDIR $HOME/app
@@ -33,4 +48,4 @@ WORKDIR $HOME/app
33
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
34
  COPY --chown=user . $HOME/app
35
 
36
- CMD ["python", "app.py"]
 
1
+ FROM pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel
2
+
3
+ ARG DEBIAN_FRONTEND=noninteractive
4
+ ENV PYTHONUNBUFFERED=1
5
+
6
+ RUN apt-get update && apt-get install --no-install-recommends -y \
7
+ build-essential \
8
+ # python3.9 \ # Commented out as it might be pre-installed
9
+ python3-pip \
10
+ git \
11
+ ffmpeg \
12
+ libsm6 \
13
+ libxext6 \
14
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
15
 
16
  WORKDIR /code
17
 
 
19
 
20
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
21
 
 
 
 
22
  # mim openmmlabs installs (quick fix..)
23
  RUN mim install mmengine
24
  RUN mim install mmcv
 
27
 
28
  # Set up a new user named "user" with user ID 1000
29
  RUN useradd -m -u 1000 user
30
+
31
  # Switch to the "user" user
32
  USER user
33
 
 
 
 
 
34
  ENV HOME=/home/user \
35
+ PATH=/home/user/.local/bin:$PATH \
36
+ PYTHONPATH=$HOME/app \
37
+ PYTHONUNBUFFERED=1 \
38
+ GRADIO_ALLOW_FLAGGING=never \
39
+ GRADIO_NUM_PORTS=1 \
40
+ GRADIO_SERVER_NAME=0.0.0.0 \
41
+ GRADIO_THEME=huggingface \
42
+ SYSTEM=spaces \
43
+ AM_I_IN_A_DOCKER_CONTAINER=Yes
44
 
45
  # Set the working directory to the user's home directory
46
  WORKDIR $HOME/app
 
48
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
49
  COPY --chown=user . $HOME/app
50
 
51
+ CMD ["python3", "app.py"]
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
- torch==2.0.1
2
  torchvision==0.15.2
3
  openmim==0.3.9
4
  gradio==3.41.0
 
1
+ torch==2.0.0
2
  torchvision==0.15.2
3
  openmim==0.3.9
4
  gradio==3.41.0