mac9087 commited on
Commit
b2fd29f
·
verified ·
1 Parent(s): ab52342

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -11
Dockerfile CHANGED
@@ -1,9 +1,9 @@
1
- # Dockerfile - Improved with more efficient caching and smaller image size
2
  FROM python:3.10-slim
3
 
4
  WORKDIR /app
5
 
6
- # Set environment variables
7
  ENV HF_HOME=/tmp/huggingface
8
  ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers
9
  ENV HF_DATASETS_CACHE=/tmp/huggingface/datasets
@@ -12,8 +12,12 @@ ENV PYTHONUNBUFFERED=1
12
  ENV MPLCONFIGDIR=/tmp/matplotlib
13
  ENV CUDA_VISIBLE_DEVICES=""
14
  ENV HOME=/tmp
 
 
 
 
15
 
16
- # Install system dependencies - grouped to reduce layers and image size
17
  RUN apt-get update && apt-get install -y --no-install-recommends \
18
  git \
19
  build-essential \
@@ -28,19 +32,29 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
28
  libopencv-dev \
29
  && apt-get clean && rm -rf /var/lib/apt/lists/*
30
 
31
- # Install Point-E and dependencies - ordered from least to most likely to change
 
 
 
 
 
 
 
 
 
 
32
  RUN pip install --no-cache-dir -U pip && \
33
- pip install --no-cache-dir torch==1.13.1 torchvision==0.14.1 --index-url https://download.pytorch.org/whl/cpu && \
 
 
 
34
  pip install --no-cache-dir flask flask-cors open3d opencv-python-headless requests tqdm && \
35
  pip install --no-cache-dir git+https://github.com/openai/point-e.git && \
36
  pip cache purge
37
 
38
- # Create a directory for model storage
39
- RUN mkdir -p /tmp/point_e_models
40
-
41
- # Copy application code and download script
42
- COPY download_weights.py .
43
- COPY app.py .
44
 
45
  # Run the download script as part of the container build
46
  RUN python download_weights.py
 
1
+ # Dockerfile - Fixed with correct NumPy version and permissions
2
  FROM python:3.10-slim
3
 
4
  WORKDIR /app
5
 
6
+ # Set environment variables - Adjust cache directories to locations with write permission
7
  ENV HF_HOME=/tmp/huggingface
8
  ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers
9
  ENV HF_DATASETS_CACHE=/tmp/huggingface/datasets
 
12
  ENV MPLCONFIGDIR=/tmp/matplotlib
13
  ENV CUDA_VISIBLE_DEVICES=""
14
  ENV HOME=/tmp
15
+ # Important: Set CLIP cache directory to writable location
16
+ ENV CLIP_MODEL_DIR=/tmp/clip_models
17
+ # Set Point-E model cache directory to writable location
18
+ ENV POINT_E_CACHE_DIR=/tmp/point_e_model_cache
19
 
20
+ # Install system dependencies
21
  RUN apt-get update && apt-get install -y --no-install-recommends \
22
  git \
23
  build-essential \
 
32
  libopencv-dev \
33
  && apt-get clean && rm -rf /var/lib/apt/lists/*
34
 
35
+ # Create all necessary directories with correct permissions
36
+ RUN mkdir -p /tmp/point_e_models \
37
+ /tmp/clip_models \
38
+ /tmp/point_e_model_cache \
39
+ /tmp/huggingface \
40
+ /tmp/huggingface/transformers \
41
+ /tmp/huggingface/datasets \
42
+ /tmp/matplotlib \
43
+ && chmod -R 777 /tmp
44
+
45
+ # Install compatible NumPy version first
46
  RUN pip install --no-cache-dir -U pip && \
47
+ pip install --no-cache-dir numpy==1.24.3 # Use v1.x compatible with Point-E
48
+
49
+ # Install Point-E and dependencies
50
+ RUN pip install --no-cache-dir torch==1.13.1 torchvision==0.14.1 --index-url https://download.pytorch.org/whl/cpu && \
51
  pip install --no-cache-dir flask flask-cors open3d opencv-python-headless requests tqdm && \
52
  pip install --no-cache-dir git+https://github.com/openai/point-e.git && \
53
  pip cache purge
54
 
55
+ # Copy application code
56
+ COPY app.py.fixed /app/app.py
57
+ COPY download_weights.py /app/download_weights.py
 
 
 
58
 
59
  # Run the download script as part of the container build
60
  RUN python download_weights.py