FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive ENV PYTHONUNBUFFERED=1 ENV HF_HOME=/workspace/.cache/huggingface ENV TRANSFORMERS_CACHE=/workspace/.cache/huggingface ENV DIFFUSERS_CACHE=/workspace/.cache/huggingface # Install python3.11 from deadsnakes PPA RUN apt-get update && apt-get install -y software-properties-common && add-apt-repository -y ppa:deadsnakes/ppa && apt-get update && apt-get install -y \ python3.11 python3.11-venv \ ffmpeg libavcodec-dev libavformat-dev libswscale-dev \ git wget curl libgl1-mesa-glx libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Install pip for python3.11 RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11 # Upgrade pip RUN python3.11 -m pip install --upgrade pip setuptools wheel # Install Python deps COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Application WORKDIR /workspace COPY . /workspace # Create dirs RUN mkdir -p /workspace/outputs /workspace/.cache/huggingface EXPOSE 7860 CMD ["python3.11", "app.py"]