ygauravyy commited on
Commit
a3044ee
1 Parent(s): 7822cdd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -6
Dockerfile CHANGED
@@ -2,7 +2,7 @@
2
 
3
  FROM continuumio/miniconda3:24.1.2-0
4
 
5
- # Install OS dependencies including xauth for xvfb
6
  RUN mkdir -p /usr/share/man/man1
7
  RUN apt-get update && \
8
  DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
@@ -29,16 +29,16 @@ RUN pip install mmdet==2.27.0
29
  RUN pip install torchserve
30
  RUN pip install mmpose==0.29.0
31
  RUN pip install torchvision==0.15.1
32
- RUN pip install numpy==1.24.4 scikit-image scipy opencv-python requests pyyaml flask glfw PyOpenGL Pillow shapely tqdm fastapi uvicorn gradio
33
 
34
- # Bugfix for xtcocoapi, a dependency of mmpose
35
  RUN git clone https://github.com/jin-s13/xtcocoapi.git
36
  WORKDIR xtcocoapi
37
  RUN pip install -r requirements.txt
38
  RUN python setup.py install
39
  WORKDIR /
40
 
41
- # Prep TorchServe
42
  RUN mkdir -p /home/torchserve/model-store
43
  RUN wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_detector.mar -P /home/torchserve/model-store/
44
  RUN wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_pose_estimator.mar -P /home/torchserve/model-store/
@@ -63,7 +63,7 @@ USER appuser
63
 
64
  EXPOSE 7860
65
 
66
- # Start TorchServe, warm-up models, then run the FastAPI app.
67
  # Using xvfb-run for headless rendering.
68
  CMD sh -c "\
69
  torchserve --start --ncs --ts-config /home/torchserve/config.properties && \
@@ -71,5 +71,5 @@ CMD sh -c "\
71
  # Warm-up requests with a small test image to load models into memory.
72
  curl -X POST http://localhost:8080/predictions/drawn_humanoid_detector -F image=@/app/examples/test.png && \
73
  curl -X POST http://localhost:8080/predictions/drawn_humanoid_pose_estimator -F image=@/app/examples/test.png && \
74
- xvfb-run -a uvicorn app:app --host 0.0.0.0 --port ${PORT:-7860} \
75
  "
 
2
 
3
  FROM continuumio/miniconda3:24.1.2-0
4
 
5
+ # install os dependencies including xauth for xvfb
6
  RUN mkdir -p /usr/share/man/man1
7
  RUN apt-get update && \
8
  DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
 
29
  RUN pip install torchserve
30
  RUN pip install mmpose==0.29.0
31
  RUN pip install torchvision==0.15.1
32
+ RUN pip install numpy==1.24.4 scikit-image scipy opencv-python requests pyyaml flask glfw PyOpenGL Pillow shapely tqdm gradio
33
 
34
+ # bugfix for xtcocoapi, a dependency of mmpose
35
  RUN git clone https://github.com/jin-s13/xtcocoapi.git
36
  WORKDIR xtcocoapi
37
  RUN pip install -r requirements.txt
38
  RUN python setup.py install
39
  WORKDIR /
40
 
41
+ # prep torchserve
42
  RUN mkdir -p /home/torchserve/model-store
43
  RUN wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_detector.mar -P /home/torchserve/model-store/
44
  RUN wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_pose_estimator.mar -P /home/torchserve/model-store/
 
63
 
64
  EXPOSE 7860
65
 
66
+ # Start TorchServe, warm-up models, then run the app.
67
  # Using xvfb-run for headless rendering.
68
  CMD sh -c "\
69
  torchserve --start --ncs --ts-config /home/torchserve/config.properties && \
 
71
  # Warm-up requests with a small test image to load models into memory.
72
  curl -X POST http://localhost:8080/predictions/drawn_humanoid_detector -F image=@/app/examples/test.png && \
73
  curl -X POST http://localhost:8080/predictions/drawn_humanoid_pose_estimator -F image=@/app/examples/test.png && \
74
+ xvfb-run -a python app.py \
75
  "