File size: 766 Bytes
57d5bb1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Dockerfile for MovieGen Demo (CPU-only by default)
# To enable GPU, use a CUDA base image and install requirements-gpu.txt

FROM python:3.12

WORKDIR /app

# System dependencies
RUN apt-get update && apt-get install -y \
    ffmpeg \
    git \
    && rm -rf /var/lib/apt/lists/*

# Copy code
COPY . /app

# Install Python dependencies (CPU by default)
RUN pip install --upgrade pip && \
    pip install -r requirements.txt

# Detect if running in a CUDA environment and install GPU dependencies if so
RUN if python -c "import torch; print(torch.cuda.is_available())" | grep -q True; then \
    pip install -r requirements-gpu.txt; \
    echo 'Installed GPU dependencies.'; \
else \
    echo 'Running in CPU-only mode.'; \
fi

EXPOSE 7860

CMD ["python", "app.py"]