File size: 1,755 Bytes
9ede49e
5afbe18
5e1192b
 
ce859c4
 
5e1192b
ce859c4
 
5e1192b
 
 
 
 
 
5afbe18
1c81260
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5afbe18
1c81260
 
 
 
 
 
 
 
5e1192b
5afbe18
9ede49e
5e1192b
 
 
5afbe18
5e1192b
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
FROM python:3.10-slim

ENV PYTHONUNBUFFERED=1

RUN apt-get update && \
    apt-get install -y --no-install-recommends ffmpeg libsm6 libxext6 && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

ARG APP_USER_UID=1000
ARG APP_USER_GID=1000
RUN groupadd --gid $APP_USER_GID appgroup && \
    useradd --uid $APP_USER_UID --gid appgroup --shell /bin/bash --create-home appuser

WORKDIR /home/appuser/app

# Upgrade pip first
RUN pip install --no-cache-dir --upgrade pip

# Attempt to install moviepy and key dependencies explicitly first
# Adding print statements to check versions during build
RUN echo "Python version: $(python --version)" && \
    echo "Pip version: $(pip --version)" && \
    echo "Attempting explicit MoviePy installation..." && \
    pip install --no-cache-dir \
        "numpy>=1.17" \
        "decorator>=4.0.2" \
        "proglog>=0.1.9" \
        "imageio>=2.5" \
        "imageio-ffmpeg>=0.4.0" \
        "moviepy>=1.0.3" && \
    echo "Explicit MoviePy installation attempt finished." && \
    echo "Checking installed packages:" && \
    pip list

COPY requirements.txt ./
# Ensure requirements.txt doesn't also list moviepy if installed explicitly above
# or ensure versions are compatible. For now, let's assume moviepy is *only* installed above.
# If moviepy is also in requirements.txt, pip might try to reinstall or change version.
RUN echo "Installing packages from requirements.txt..." && \
    pip install --no-cache-dir -r requirements.txt && \
    echo "Finished installing from requirements.txt." && \
    echo "Final check of installed packages:" && \
    pip list


COPY . .
RUN chown -R appuser:appgroup /home/appuser/app
USER appuser

EXPOSE 8501
CMD ["streamlit", "run", "app.py", "--server.headless=true"]