ygauravyy commited on
Commit
2acc806
1 Parent(s): 0cd678c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +43 -25
Dockerfile CHANGED
@@ -1,28 +1,46 @@
1
- # syntax=docker/dockerfile:1.2
2
 
3
  FROM continuumio/miniconda3:24.1.2-0
4
 
5
- USER root
6
- WORKDIR /app
7
-
8
- # Copy all repo files into /app
9
- COPY . /app
10
-
11
- # Run the torchserve setup script that replicates steps from the original torchserve/Dockerfile
12
- RUN chmod +x /app/torchserve_setup.sh && /app/torchserve_setup.sh
13
-
14
- # Install your package in editable mode
15
- RUN pip install -e .
16
-
17
- # IMPORTANT: Change ownership of /app to the non-root user (with UID 1000)
18
- # Hugging Face Spaces runs the container as a non-root user with UID 1000 by default.
19
- RUN chown -R 1000:1000 /app
20
-
21
- # Switch to the non-root user
22
- USER 1000
23
-
24
- # Expose port 7860 for Gradio on Hugging Face Spaces
25
- EXPOSE 7860
26
-
27
- # Run the Gradio app as the non-root user now that it has proper permissions
28
- CMD ["python", "app.py"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # syntax = docker/dockerfile:1.2
2
 
3
  FROM continuumio/miniconda3:24.1.2-0
4
 
5
+ # install os dependencies
6
+ RUN mkdir -p /usr/share/man/man1
7
+ RUN apt-get update && \
8
+ DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
9
+ ca-certificates \
10
+ curl \
11
+ vim \
12
+ sudo \
13
+ default-jre \
14
+ git \
15
+ gcc \
16
+ build-essential \
17
+ && rm -rf /var/lib/apt/lists/*
18
+
19
+ RUN conda install python=3.8.13 -y
20
+
21
+
22
+ # install python dependencies
23
+ RUN pip install openmim
24
+ RUN pip install torch==2.0.0
25
+ RUN mim install mmcv-full==1.7.0
26
+ RUN pip install mmdet==2.27.0
27
+ RUN pip install torchserve
28
+
29
+ # bugfix for xtcocoapi, an mmpose dependency
30
+ RUN git clone https://github.com/jin-s13/xtcocoapi.git
31
+ WORKDIR xtcocoapi
32
+ RUN pip install -r requirements.txt
33
+ RUN python setup.py install
34
+ WORKDIR /
35
+ RUN pip install mmpose==0.29.0
36
+ RUN pip install torchvision==0.15.1 # solve torch version problem
37
+ RUN pip install numpy==1.24.4 #solve numpy version problem
38
+
39
+ # prep torchserve
40
+ RUN mkdir -p /home/torchserve/model-store
41
+ RUN wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_detector.mar -P /home/torchserve/model-store/
42
+ RUN wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_pose_estimator.mar -P /home/torchserve/model-store/
43
+ COPY config.properties /home/torchserve/config.properties
44
+
45
+ # starting command
46
+ CMD /opt/conda/bin/torchserve --start --disable-token-auth --ts-config /home/torchserve/config.properties && sleep infinity