FROM python:3.9 # Create a non-root user RUN useradd -m -u 1000 user USER user WORKDIR /home/user ENV PATH="/home/user/.local/bin:$PATH" # Copy your code COPY --chown=user . . # Install dependencies RUN pip install --no-cache-dir --upgrade pip setuptools wheel RUN pip install --no-cache-dir -e . # Prepare TorchServe model store RUN mkdir -p /home/torchserve/model-store RUN wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_detector.mar -P /home/torchserve/model-store/ RUN wget https://github.com/facebookresearch/AnimatedDrawings/releases/download/v0.0.1/drawn_humanoid_pose_estimator.mar -P /home/torchserve/model-store/ # Expose port 7860 for Gradio EXPOSE 7860 CMD ["python", "app.py"]