root commited on
Commit
1fa8a29
·
1 Parent(s): 0def43d

update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -17
Dockerfile CHANGED
@@ -1,36 +1,22 @@
1
- # Use the official lightweight Python image.
2
- # https://hub.docker.com/_/python
3
  FROM python:3.10-slim
4
 
5
  # Copy local code to the container image.
6
  ENV APP_HOME /app
7
  WORKDIR $APP_HOME
8
- # COPY . ./
9
 
10
  RUN apt update && apt install -y \
11
  libgl1-mesa-glx \
12
  libglib2.0-dev \
13
  git
14
 
15
- # Install production dependencies.
16
- RUN pip install --upgrade pip
17
 
18
- RUN git clone https://github.com/LiteraturePro/MODNet.git
19
-
20
- RUN cp -r MODNet/* ./
21
-
22
- RUN pip install -r requirements.txt
23
 
24
  # CPU
25
- #RUN pip install torch==1.7.1+cpu torchvision==0.8.2+cpu torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
26
  RUN pip install torch==1.13.0+cpu torchvision==0.14.0+cpu torchaudio==0.13.0 --extra-index-url https://download.pytorch.org/whl/cpu
27
 
28
- # Run the web service on container startup. Here we use the gunicorn
29
- # webserver, with one worker process and 8 threads.
30
- # For environments with multiple CPU cores, increase the number of workers
31
- # to be equal to the cores available.
32
- # CMD exec gunicorn --bind 0.0.0.0:7860 --workers 1 --threads 8 --timeout 0 app:app
33
 
 
34
  # CMD exec gunicorn --bind 0.0.0.0:$PORT --workers 1 --threads 8 --timeout 0 app:app
35
-
36
  CMD ["bash", "run.sh"]
 
 
 
1
  FROM python:3.10-slim
2
 
3
  # Copy local code to the container image.
4
  ENV APP_HOME /app
5
  WORKDIR $APP_HOME
 
6
 
7
  RUN apt update && apt install -y \
8
  libgl1-mesa-glx \
9
  libglib2.0-dev \
10
  git
11
 
12
+ RUN git clone https://github.com/LiteraturePro/MODNet.git && cp -r MODNet/* ./
 
13
 
14
+ RUN pip install --upgrade pip && pip install -r requirements.txt
 
 
 
 
15
 
16
  # CPU
 
17
  RUN pip install torch==1.13.0+cpu torchvision==0.14.0+cpu torchaudio==0.13.0 --extra-index-url https://download.pytorch.org/whl/cpu
18
 
 
 
 
 
 
19
 
20
+ # CMD exec gunicorn --bind 0.0.0.0:7860 --workers 1 --threads 8 --timeout 0 app:app
21
  # CMD exec gunicorn --bind 0.0.0.0:$PORT --workers 1 --threads 8 --timeout 0 app:app
 
22
  CMD ["bash", "run.sh"]