FROM python:3.11.4-slim-bullseye as install-browser RUN apt-get update \ && apt-get satisfy -y \ "chromium, chromium-driver (>= 115.0)" \ && chromium --version && chromedriver --version FROM install-browser as user-install ENV PIP_ROOT_USER_ACTION=ignore RUN mkdir /usr/src/app WORKDIR /usr/src/app # COPY ./requirements.txt ./requirements.txt COPY ./ ./ RUN pip install -r requirements.txt FROM user-install AS user RUN useradd -ms /bin/bash user \ && chown -R user:user /usr/src/app RUN chown user:user /home RUN chmod 755 /home USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH \ PYTHONPATH=$HOME/app \ PYTHONUNBUFFERED=1 \ GRADIO_ALLOW_FLAGGING=never \ GRADIO_NUM_PORTS=1 \ GRADIO_SERVER_NAME=0.0.0.0 \ GRADIO_THEME=huggingface \ SYSTEM=spaces CMD python app.py --host 0.0.0.0 --port 7860