MoviiGen-Demo / Dockerfile
myschoolstory
Update and optimize for CPU.
57d5bb1
raw
history blame contribute delete
766 Bytes
# 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"]