|
|
FROM python:3.10-slim |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
|
build-essential \ |
|
|
wget \ |
|
|
git \ |
|
|
libgl1 \ |
|
|
libglib2.0-0 \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
|
USER user |
|
|
ENV HOME=/home/user \ |
|
|
PATH=/home/user/.local/bin:$PATH |
|
|
|
|
|
WORKDIR $HOME/app |
|
|
|
|
|
|
|
|
COPY --chown=user requirements.txt . |
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir --upgrade pip |
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu |
|
|
|
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir --no-build-isolation "git+https://github.com/facebookresearch/detectron2.git" |
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
|
|
|
COPY --chown=user . . |
|
|
|
|
|
|
|
|
CMD ["python", "app.py"] |