sohamnk commited on
Commit
696257d
·
verified ·
1 Parent(s): be0f335
Files changed (1) hide show
  1. Dockerfile +7 -6
Dockerfile CHANGED
@@ -1,24 +1,25 @@
1
  FROM python:3.10-slim
2
 
3
-
4
  WORKDIR /code
5
 
6
  ENV HF_HOME=/tmp/huggingface_cache
7
  ENV TORCH_HOME=/tmp/torch_cache
8
 
 
9
  RUN mkdir -p $HF_HOME && chmod -R 777 $HF_HOME
10
  RUN mkdir -p $TORCH_HOME && chmod -R 777 $TORCH_HOME
11
 
12
- # dependencies required by OpenCV
13
  RUN apt-get update && apt-get install -y \
14
- libgl1 \
15
  libglib2.0-0 \
16
- && rm -rf /var/lib/apt/lists/*
17
-
18
 
19
  COPY ./requirements.txt /code/requirements.txt
 
20
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
21
 
22
  COPY . /code/
23
 
24
- CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "300", "pipeline:app"]
 
1
  FROM python:3.10-slim
2
 
3
+ # working directory
4
  WORKDIR /code
5
 
6
  ENV HF_HOME=/tmp/huggingface_cache
7
  ENV TORCH_HOME=/tmp/torch_cache
8
 
9
+ # explicitly create cache directory
10
  RUN mkdir -p $HF_HOME && chmod -R 777 $HF_HOME
11
  RUN mkdir -p $TORCH_HOME && chmod -R 777 $TORCH_HOME
12
 
13
+ # dependency req by open cv
14
  RUN apt-get update && apt-get install -y \
15
+ libgl1-mesa-glx \
16
  libglib2.0-0 \
17
+ && rm -rf /var/lib/apt/lists/*
 
18
 
19
  COPY ./requirements.txt /code/requirements.txt
20
+
21
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
22
 
23
  COPY . /code/
24
 
25
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "300", "app:app"]