|
|
|
FROM python:3.9-slim |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
libgl1-mesa-glx \ |
|
libglib2.0-0 \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
ENV MPLCONFIGDIR=/app/tmp/matplotlib |
|
ENV YOLO_CONFIG_DIR=/app/tmp/Ultralytics |
|
|
|
|
|
RUN mkdir -p /app/tmp/matplotlib \ |
|
/app/tmp/Ultralytics \ |
|
/app/dataset/train/images \ |
|
/app/dataset/train/labels \ |
|
/app/dataset/val/images \ |
|
/app/dataset/val/labels \ |
|
&& chmod -R 777 /app/tmp /app/dataset |
|
|
|
|
|
COPY . /app |
|
|
|
|
|
COPY sam2/sam2_hiera_l.yaml /app/sam2/ |
|
COPY sam2/sam2.1_hiera_large.pt /app/sam2/ |
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["python", "app.py"] |