File size: 996 Bytes
783f65d
464749e
34b88b6
f3e010b
 
 
464749e
f3e010b
464749e
34b88b6
 
 
 
 
 
 
 
 
f3e010b
34b88b6
 
f3e010b
 
464749e
34b88b6
6ad429f
 
 
464749e
828c5f0
 
6ad429f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM python:3.8

# Create a non-root user
RUN useradd -m -u 1000 user
USER user
WORKDIR /home/user

ENV PATH="/home/user/.local/bin:$PATH"

# Install system packages needed for OpenCV
USER root
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y \
    libgl1-mesa-glx libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*
USER user

# Copy your code
COPY --chown=user . .

# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
RUN pip install --no-cache-dir -e .

# Create model-store directory (ensure the path is correct and accessible)
RUN mkdir -p /home/user/torchserve/model-store
RUN wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_detector.mar -P /home/user/torchserve/model-store/
RUN wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_pose_estimator.mar -P /home/user/torchserve/model-store/

EXPOSE 7860

CMD ["python", "app.py"]