jbilcke-hf's picture
jbilcke-hf HF Staff
Upload 76 files
260ff53 verified
FROM nvidia/cuda:12.0.1-runtime-ubuntu22.04
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-dev \
ffmpeg \
libsm6 \
libxext6 \
libxrender-dev \
libglib2.0-0 \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy requirements first to leverage Docker caching
COPY requirements.txt .
# Install Python dependencies
RUN pip3 install --no-cache-dir -r requirements.txt
RUN pip3 install aiohttp
# Install additional required packages
RUN pip3 install --no-cache-dir torch torchvision torchaudio
# Copy application code
COPY . .
# Create assets directory if it doesn't exist
RUN mkdir -p /app/assets
# Expose the port used by the server
EXPOSE 8080
# Set entry command
CMD ["python3", "server.py", "--host", "0.0.0.0", "--port", "8080"]