mac9087 commited on
Commit
031f60b
·
verified ·
1 Parent(s): d6ba12d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -8
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
@@ -11,22 +11,31 @@ RUN apt-get update && apt-get install -y \
11
  ffmpeg \
12
  libsm6 \
13
  libxext6 \
 
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
- # Copy requirements first for better caching
17
- COPY requirements.txt .
 
 
18
  RUN pip install --upgrade pip && \
19
- pip install --no-cache-dir pyyaml && \
20
- pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
21
 
22
  # Copy the Flask application
23
  COPY app.py .
24
 
25
- # Create output directory
26
- RUN mkdir -p outputs
27
-
28
  # Expose the port
29
  EXPOSE 7860
30
 
 
 
 
31
  # Run the application with timeout set to 300 seconds for longer model loading
32
  CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "300", "app:app"]
 
1
+ FROM python:3.10
2
 
3
  WORKDIR /app
4
 
 
11
  ffmpeg \
12
  libsm6 \
13
  libxext6 \
14
+ cmake \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
+ # Create output directory
18
+ RUN mkdir -p outputs
19
+
20
+ # Install PyTorch first separately (for better error reporting)
21
  RUN pip install --upgrade pip && \
22
+ pip install --no-cache-dir torch==2.0.1 numpy==1.24.2
23
+
24
+ # Install other Python dependencies
25
+ COPY requirements.txt .
26
+ RUN pip install --no-cache-dir -r requirements.txt
27
+
28
+ # Install Shap-E from source
29
+ RUN pip install --no-cache-dir "git+https://github.com/openai/shap-e.git@main"
30
 
31
  # Copy the Flask application
32
  COPY app.py .
33
 
 
 
 
34
  # Expose the port
35
  EXPOSE 7860
36
 
37
+ # Set environment variables
38
+ ENV PYTHONUNBUFFERED=1
39
+
40
  # Run the application with timeout set to 300 seconds for longer model loading
41
  CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "300", "app:app"]