# Use an official Python base image | |
FROM python:3.10-slim | |
# Set the working directory | |
WORKDIR /app | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y \ | |
git \ | |
git-lfs \ | |
ffmpeg \ | |
libsm6 \ | |
libxext6 \ | |
cmake \ | |
rsync \ | |
libgl1-mesa-glx \ | |
curl && \ | |
rm -rf /var/lib/apt/lists/* && \ | |
git lfs install | |
# Install Node.js (if needed) | |
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs | |
# Install torch separately before other dependencies to avoid issues | |
RUN pip install --no-cache-dir torch==2.4.1 | |
# Copy requirements.txt file | |
COPY requirements.txt /app/requirements.txt | |
# Install the remaining Python dependencies | |
RUN pip install --no-cache-dir -r /app/requirements.txt | |
# Copy the rest of your app's code to the container | |
COPY . /app | |
# Set the entry point for your app (optional, customize as needed) | |
CMD ["python", "app.py"] | |