manim / Dockerfile
tommy24's picture
Update Dockerfile
dbe2549 verified
# # Use an official Python base image
# FROM python:3.9
# # Set environment variables
# ENV PYTHONUNBUFFERED=1 \
# PYTHONDONTWRITEBYTECODE=1
# RUN pip install importlib-metadata
# # Install required system libraries for Manim and dependencies
# RUN apt-get update && apt-get install -y \
# ffmpeg \
# libcairo2 \
# libpango1.0-0 \
# libx11-6 \
# libgl1-mesa-glx \
# xvfb \
# pkg-config \
# libpango1.0-dev \
# libcairo2-dev \
# && apt-get clean
# # Set the working directory
# WORKDIR /app
# # Copy project files
# COPY . /app
# # Install Python dependencies
# RUN pip install --no-cache-dir --upgrade pip
# COPY requirements.txt .
# RUN pip install --no-cache-dir -r requirements.txt
# # Expose the port
# EXPOSE 7860
# # Run the FastAPI server
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
# # Use an official Python runtime as a parent image
# FROM python:3.9-slim
# # Set the working directory in the container
# WORKDIR /app
# # Install system dependencies required for building the Python packages and ffmpeg
# RUN apt-get update && apt-get install -y \
# pkg-config \
# libpango1.0-dev \
# libcairo2-dev \
# libpangocairo-1.0-0 \
# gcc \
# g++ \
# libglib2.0-dev \
# ffmpeg \
# && rm -rf /var/lib/apt/lists/*
# # Upgrade pip to the latest version
# RUN pip install --upgrade pip
# # Copy the current directory contents into the container at /app
# COPY . /app
# # Install Python dependencies
# RUN pip install --no-cache-dir -r requirements.txt
# # Expose the port your app will run on (adjust based on your app's needs)
# EXPOSE 7860
# # Define the command to run your application
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
# # Use a Python 3.9 base image
# FROM python:3.9-slim
# # Set the working directory in the container
# WORKDIR /app
# # Install necessary dependencies
# RUN apt-get update && \
# apt-get install -y \
# ffmpeg \
# && rm -rf /var/lib/apt/lists/*
# # Install Python dependencies
# COPY requirements.txt .
# RUN pip install --no-cache-dir -r requirements.txt
# # Copy the application files into the container
# COPY . .
# # Expose the port for the app
# EXPOSE 7860
# # Set the entry point to run the app
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
# Use the official Python image
FROM python:3.9-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
g++ \
make \
pkg-config \
libcairo2-dev \
libpango1.0-dev \
libpangocairo-1.0-0 \
python3-dev \
libffi-dev \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Copy requirements file and install dependencies
COPY requirements.txt .
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
EXPOSE 7860
# Define the entrypoint (replace this with your command, e.g., flask or uvicorn)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]