# syntax = docker/dockerfile:1.2 FROM continuumio/miniconda3:24.1.2-0 # install os dependencies RUN mkdir -p /usr/share/man/man1 RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ ca-certificates \ curl \ vim \ sudo \ default-jre \ git \ gcc \ g++ \ build-essential \ ninja-build \ && rm -rf /var/lib/apt/lists/* RUN conda install python=3.8.13 -y # Set environment variables for MMCV compilation ENV FORCE_CUDA="0" ENV MMCV_WITH_OPS=1 ENV MMCV_WITH_CUDA=0 ENV MAX_JOBS=1 # install python dependencies (without MMCV) COPY requirements.txt /tmp/requirements.txt RUN pip install --no-cache-dir torch==2.0.0 torchvision==0.15.1 numpy==1.24.4 && \ pip install --no-cache-dir -r /tmp/requirements.txt # Install MMCV pre-built wheel for CPU RUN pip install --no-cache-dir mmcv-full==1.7.0 -f https://download.openmmlab.com/mmcv/dist/cpu/torch2.0.0/index.html # prep torchserve 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/ COPY config.properties /home/torchserve/config.properties # Create logs directory with proper permissions RUN mkdir -p /home/torchserve/logs && \ chmod -R 777 /home/torchserve/logs # Set environment variables ENV PYTHONUNBUFFERED=1 ENV TS_LOG_FILE=/home/torchserve/logs/ts_log.log ENV MODEL_STORE=/home/torchserve/model-store ENV LOG_LOCATION=/home/torchserve/logs/ ENV METRICS_LOCATION=/home/torchserve/logs/ ENV ENABLE_METRICS_LOGGING=false # Expose TorchServe ports EXPOSE 8080 EXPOSE 8081 EXPOSE 8082 # Start TorchServe CMD ["torchserve", "--start", "--disable-token-auth", "--ts-config", "/home/torchserve/config.properties", "--foreground"]