Create Dockerfile
Browse files- Dockerfile +43 -0
Dockerfile
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Debian Buster (older Linux) to support PyTorch 1.12 executable stack requirements
|
| 2 |
+
FROM python:3.9-slim-buster
|
| 3 |
+
|
| 4 |
+
# Install system dependencies required for Open3D and Binvox
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
libgl1-mesa-glx \
|
| 7 |
+
libgomp1 \
|
| 8 |
+
curl \
|
| 9 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
+
|
| 11 |
+
WORKDIR /app
|
| 12 |
+
|
| 13 |
+
# 1. Install PyTorch 1.12.0 (CPU) from OFFICIAL source
|
| 14 |
+
# This avoids the faulty wheels sometimes found in mirrors
|
| 15 |
+
RUN pip install --no-cache-dir torch==1.12.0 torchvision==0.13.0 --extra-index-url https://download.pytorch.org/whl/cpu
|
| 16 |
+
|
| 17 |
+
# 2. Install PyTorch Geometric dependencies (CPU versions matching Torch 1.12)
|
| 18 |
+
RUN pip install --no-cache-dir \
|
| 19 |
+
torch-scatter==2.0.9 \
|
| 20 |
+
torch-sparse==0.6.15 \
|
| 21 |
+
torch-cluster==1.6.0 \
|
| 22 |
+
torch-spline-conv==1.2.1 \
|
| 23 |
+
-f https://data.pyg.org/whl/torch-1.12.0+cpu.html
|
| 24 |
+
|
| 25 |
+
# 3. Install the rest of the libraries
|
| 26 |
+
# Unpin Open3D to allow a version compatible with Python 3.9
|
| 27 |
+
RUN pip install --no-cache-dir \
|
| 28 |
+
torch-geometric==1.7.2 \
|
| 29 |
+
numpy \
|
| 30 |
+
scipy \
|
| 31 |
+
trimesh \
|
| 32 |
+
open3d \
|
| 33 |
+
gradio
|
| 34 |
+
|
| 35 |
+
# 4. Copy Application Code
|
| 36 |
+
COPY . /app
|
| 37 |
+
|
| 38 |
+
# 5. Permissions
|
| 39 |
+
# Ensure we can execute the app and binvox (if copied by app.py)
|
| 40 |
+
RUN chmod -R 777 /app
|
| 41 |
+
|
| 42 |
+
# 6. Launch
|
| 43 |
+
CMD ["python", "app.py"]
|