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