File size: 1,067 Bytes
031f60b
00cdc08
1e13ee1
e16b8f7
b2fd29f
7206190
1e13ee1
f551078
1e13ee1
 
5073106
 
 
031f60b
7206190
b2fd29f
039c9f7
 
 
 
 
031f60b
feee71f
 
031f60b
 
feee71f
 
 
 
00cdc08
7206190
00cdc08
eebaf66
031f60b
 
feee71f
039c9f7
031f60b
5073106
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM python:3.10

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    build-essential \
    libgl1-mesa-glx \
    libglib2.0-0 \
    ffmpeg \
    libsm6 \
    libxext6 \
    cmake \
    && rm -rf /var/lib/apt/lists/*

# Create output directory and model cache with appropriate permissions
RUN mkdir -p outputs && \
    mkdir -p /app/shap_e_model_cache && \
    chmod 777 /app/shap_e_model_cache && \
    chmod 777 outputs

# Copy application code
COPY app.py .
COPY requirements.txt .

# Install Python dependencies - let Shap-E determine the correct versions
RUN pip install --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt && \
    pip install --no-cache-dir "git+https://github.com/openai/shap-e.git@main"

# Expose the port
EXPOSE 7860

# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV SHAPEE_NO_INTERACTIVE=1
ENV XDG_CACHE_HOME=/app

# Run the application with timeout set to 300 seconds for longer model loading
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "300", "app:app"]