Spaces:
Sleeping
Sleeping
FROM ubuntu:latest | |
USER root | |
ENV HOME=/home/user \ | |
PYTHONUNBUFFERED=1 \ | |
PYTHONPATH=$HOME/app/cpython \ | |
GRADIO_ALLOW_FLAGGING=never \ | |
GRADIO_NUM_PORTS=1 \ | |
GRADIO_SERVER_NAME=0.0.0.0 \ | |
GRADIO_THEME=huggingface \ | |
SYSTEM=spaces | |
WORKDIR $HOME/app | |
COPY --chown=user . $HOME/app | |
run chmod -R a+xrw . | |
run apt update | |
run apt-get install -y git curl nvidia-cuda-toolkit wget git-lfs ffmpeg libsm6 libxext6 cmake rsync gcc make python3-venv libmpdec-dev libgl1 libglx-mesa0 libegl1-mesa | |
run mkdir -p ~/miniconda3 | |
run wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh | |
run bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 | |
run rm -rf ~/miniconda3/miniconda.sh | |
run ~/miniconda3/bin/conda init bash | |
run ~/miniconda3/bin/activate | |
run ~/miniconda3/bin/conda env create -f ./env.yml | |
run git lfs install --force | |
run git clone https://github.com/python/cpython | |
run cd cpython && ./configure --enable-optimizations --with-lto --prefix=$HOME/python | |
run cd cpython && make | |
run cd cpython && make install | |
run PATH="${PATH:+${PATH}:}$HOME/python" | |
run python -m pip install --upgrade --no-cache-dir pip | |
run python -m pip install --upgrade --no-cache-dir -r deps.txt | |
EXPOSE 7860 | |
ENTRYPOINT ["python", "./code.py"] | |