FROM nvidia/cuda:12.1.0-base-ubuntu20.04 ENV TZ=Asia/Shanghai RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ && echo $TZ > /etc/timezone RUN apt-get update \ && apt-get install -y build-essential \ && apt-get install -y wget \ && apt-get install -y software-properties-common curl zip unzip git-lfs awscli libssl-dev openssh-server vim \ && apt-get install -y net-tools iputils-ping iproute2 RUN apt-get install --reinstall ca-certificates && update-ca-certificates RUN add-apt-repository -y 'ppa:deadsnakes/ppa' && apt update RUN apt install python3.10 python3.10-dev python3.10-distutils python3.10-venv -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* RUN wget -qO- https://bootstrap.pypa.io/get-pip.py | python3.10 RUN ln -s /usr/bin/python3.10 /usr/bin/python RUN pip uninstall -y Pillow && pip install pillow # https://huggingface.co/docs/hub/spaces-sdks-docker#permissions RUN useradd -m -u 1000 user USER user ENV HOME="/home/user" \ PATH="/home/user/.local/bin:${PATH}" RUN python3.10 -m pip install pipx RUN pipx install poetry RUN poetry --version || { echo 'Poetry installation check failed' ; exit 1; } WORKDIR /workspace COPY --chown=user requirements.txt . RUN pip install -r requirements.txt COPY --chown=user . . RUN pip install gradio RUN pip install openai RUN chmod +x start_app.sh CMD ["./start_app.sh", "/tmp/hf_model"]