trip33 / Dockerfile
vish85521's picture
Create Dockerfile
4c6305e verified
# Use a lightweight standard Python image
FROM python:3.10-slim
ENV DEBIAN_FRONTEND=noninteractive
# Throttle the C++ compiler so it doesn't run out of memory!
ENV MAX_JOBS=1
WORKDIR /app
# Install basic system dependencies AND the C++ compiler
RUN apt-get update && apt-get install -y \
git \
libgl1 \
libglib2.0-0 \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Force install CPU-only PyTorch to save space
RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu
# Clone the official TripoSR repository
RUN git clone https://github.com/VAST-AI-Research/TripoSR.git /app/TripoSR
# Install your web server requirements
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Install TripoSR's specific requirements (MAX_JOBS=1 keeps this safe)
RUN pip install --no-cache-dir -r /app/TripoSR/requirements.txt
# Copy your API script
COPY app.py .
# Create output directory
RUN mkdir -p /app/outputs
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]