Update Dockerfile
Browse files- Dockerfile +3 -7
Dockerfile
CHANGED
|
@@ -1,8 +1,6 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
# 1. Install system dependencies
|
| 4 |
-
# 'git' is needed to download detectron2 source
|
| 5 |
-
# 'build-essential' provides the compilers (gcc/g++)
|
| 6 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
build-essential \
|
| 8 |
wget \
|
|
@@ -26,13 +24,11 @@ COPY --chown=user requirements.txt .
|
|
| 26 |
RUN pip install --no-cache-dir --upgrade pip
|
| 27 |
|
| 28 |
# 5. Install PyTorch (CPU Version) FIRST
|
| 29 |
-
# We explicitly install the CPU version to keep the image small and compatible.
|
| 30 |
-
# Detectron2 requires PyTorch to be installed before it can build.
|
| 31 |
RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu
|
| 32 |
|
| 33 |
# 6. Install Detectron2 from Source (Official Facebook Repo)
|
| 34 |
-
#
|
| 35 |
-
RUN pip install --no-cache-dir "git+https://github.com/facebookresearch/detectron2.git"
|
| 36 |
|
| 37 |
# 7. Install the rest of the dependencies
|
| 38 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# 1. Install system dependencies
|
|
|
|
|
|
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
build-essential \
|
| 6 |
wget \
|
|
|
|
| 24 |
RUN pip install --no-cache-dir --upgrade pip
|
| 25 |
|
| 26 |
# 5. Install PyTorch (CPU Version) FIRST
|
|
|
|
|
|
|
| 27 |
RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu
|
| 28 |
|
| 29 |
# 6. Install Detectron2 from Source (Official Facebook Repo)
|
| 30 |
+
# FIX: Added '--no-build-isolation' so it can see the installed PyTorch
|
| 31 |
+
RUN pip install --no-cache-dir --no-build-isolation "git+https://github.com/facebookresearch/detectron2.git"
|
| 32 |
|
| 33 |
# 7. Install the rest of the dependencies
|
| 34 |
RUN pip install --no-cache-dir -r requirements.txt
|