Spaces:
Build error
Build error
Commit
·
3516513
1
Parent(s):
e4c2a69
update
Browse files- Dockerfile +12 -9
Dockerfile
CHANGED
|
@@ -15,23 +15,26 @@ RUN apt-get update && apt-get install -y \
|
|
| 15 |
# Set working directory
|
| 16 |
WORKDIR /app
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
RUN pip install
|
| 23 |
|
| 24 |
-
#
|
|
|
|
|
|
|
|
|
|
| 25 |
RUN mim install mmsegmentation
|
| 26 |
|
| 27 |
-
# Copy
|
| 28 |
COPY . .
|
| 29 |
|
| 30 |
-
# Install
|
| 31 |
-
RUN pip install -r requirements.txt
|
| 32 |
|
| 33 |
# Expose Gradio port
|
| 34 |
EXPOSE 7860
|
| 35 |
|
| 36 |
-
#
|
| 37 |
CMD ["python", "app.py"]
|
|
|
|
| 15 |
# Set working directory
|
| 16 |
WORKDIR /app
|
| 17 |
|
| 18 |
+
# Copy only requirements first to leverage Docker caching
|
| 19 |
+
COPY requirements.txt ./
|
| 20 |
|
| 21 |
+
# Install PyTorch (CPU version)
|
| 22 |
+
RUN pip install --no-cache-dir torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2
|
| 23 |
|
| 24 |
+
# Install OpenMMLab dependencies
|
| 25 |
+
RUN pip install --no-cache-dir mmengine mmcv-full openmim
|
| 26 |
+
|
| 27 |
+
# Install MMSegmentation using mim AFTER torch is present
|
| 28 |
RUN mim install mmsegmentation
|
| 29 |
|
| 30 |
+
# Copy rest of the application code
|
| 31 |
COPY . .
|
| 32 |
|
| 33 |
+
# Install remaining Python dependencies
|
| 34 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 35 |
|
| 36 |
# Expose Gradio port
|
| 37 |
EXPOSE 7860
|
| 38 |
|
| 39 |
+
# Start the app
|
| 40 |
CMD ["python", "app.py"]
|