Spaces:
Building
Building
Update Dockerfile
Browse files- Dockerfile +16 -37
Dockerfile
CHANGED
@@ -1,46 +1,25 @@
|
|
1 |
-
|
2 |
|
3 |
-
|
|
|
|
|
|
|
4 |
|
5 |
-
|
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 |
-
|
|
|
20 |
|
|
|
|
|
|
|
21 |
|
22 |
-
#
|
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 |
-
#
|
46 |
-
|
|
|
|
|
|
1 |
+
FROM python:3.9
|
2 |
|
3 |
+
# Create a non-root user
|
4 |
+
RUN useradd -m -u 1000 user
|
5 |
+
USER user
|
6 |
+
WORKDIR /home/user
|
7 |
|
8 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
# Copy your code
|
11 |
+
COPY --chown=user . .
|
12 |
|
13 |
+
# Install dependencies
|
14 |
+
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
|
15 |
+
RUN pip install --no-cache-dir -e .
|
16 |
|
17 |
+
# Prepare TorchServe model store
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
RUN mkdir -p /home/torchserve/model-store
|
19 |
RUN wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_detector.mar -P /home/torchserve/model-store/
|
20 |
RUN wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_pose_estimator.mar -P /home/torchserve/model-store/
|
|
|
21 |
|
22 |
+
# Expose port 7860 for Gradio
|
23 |
+
EXPOSE 7860
|
24 |
+
|
25 |
+
CMD ["python", "app.py"]
|