FROM python:3.8.1 WORKDIR /code COPY ./requirements.txt /code/requirements.txt RUN apt-get update && \ apt-get install -y sudo tmux wget curl htop make tree && \ apt-get install -y iputils-ping telnet && \ apt-get install -y git git-lfs && \ apt-get install -y libgl1-mesa-glx RUN --mount=type=secret,id=PASSWORD,mode=0444,required=true \ useradd -m -u 1000 user && \ echo "user:$(cat /run/secrets/PASSWORD)" | chpasswd && \ adduser user sudo RUN pip install -U pip pysocks RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt USER user ENV HOME=/home/user ENV PATH=$HOME/.local/bin:$PATH ENV SHELL=/bin/bash WORKDIR $HOME COPY --chown=user . $HOME/app RUN wget "https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_amd64" && mv frpc_linux_amd64 /usr/local/lib/python3.8/site-packages/gradio/frpc_linux_amd64_v0.2 COPY .bashrc $HOME/.bashrc_append RUN cat $HOME/.bashrc_append >> $HOME/.bashrc && \ rm $HOME/.bashrc_append EXPOSE 7860 ENTRYPOINT [] CMD ["/bin/bash", "./app/run.sh"]