File size: 1,378 Bytes
a531ed2
583957b
59d4479
 
 
 
04130dc
59d4479
 
 
 
 
 
 
 
 
 
 
 
 
 
 
04130dc
f388488
59d4479
 
 
 
e2e4e08
 
 
 
 
 
f388488
e2e4e08
 
 
59d4479
 
f388488
 
 
e2e4e08
59d4479
 
e2e4e08
 
 
 
59d4479
 
 
 
 
 
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Use Python 3.11 slim image
FROM python:3.11-slim

# Set working directory
WORKDIR /app

# Install system dependencies for OpenCV, audio, and moviepy
RUN apt-get update && apt-get install -y \
    libgl1-mesa-glx \
    libglib2.0-0 \
    libsm6 \
    libxext6 \
    libxrender-dev \
    libavcodec-dev \
    libavformat-dev \
    libswscale-dev \
    libv4l-dev \
    libxvidcore-dev \
    libx264-dev \
    libjpeg-dev \
    libpng-dev \
    libtiff-dev \
    ffmpeg \
    libav-tools \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements and install Python dependencies
COPY requirements.txt .

# Set environment variables to prefer pre-built wheels
ENV PIP_PREFER_BINARY=1
ENV PIP_NO_BUILD_ISOLATION=0

# Upgrade pip and install numpy first (to avoid conflicts)
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
RUN pip install --no-cache-dir "numpy>=1.24.0,<2.0.0"

# Install the rest of the requirements
RUN pip install --no-cache-dir -r requirements.txt

# Verify moviepy installation
RUN python -c "import moviepy; print('MoviePy version:', moviepy.__version__)"

# Copy the app and test script
COPY app.py .
COPY simple_model_manager.py .
COPY test_imports.py .

# Test all imports work correctly
RUN python test_imports.py

# Expose port
EXPOSE 7860

# Run Streamlit
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]