-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
82 lines (78 loc) · 3.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
FROM ubuntu:latest as base_image
USER root
ENV TZ=America/Denver
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& apt-get update \
&& apt-get upgrade -y \
&& apt install software-properties-common -y \
&& add-apt-repository ppa:ubuntu-toolchain-r/test \
&& apt-get update \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& apt install libtinfo6 -y \
&& apt-get install -y git \
&& apt-get install -y wget \
&& apt-get install -y curl \
&& apt-get install -y vim \
&& apt-get install -y software-properties-common \
&& apt-get install -y gcc-9 \
&& apt-get install -y g++-9 \
&& apt-get install -y bash \
&& apt-get install -y build-essential \
&& apt-get install -y libssl-dev \
&& apt-get install -y libffi-dev \
&& apt-get install -y libgl1-mesa-dev \
&& apt-get install -y nvidia-cuda-toolkit \
&& apt-get install -y xclip \
&& apt-get install -y libjpeg-dev \
&& apt-get install -y zlib1g-dev \
&& apt-get install -y libpng-dev \
&& apt-get install software-properties-common -y \
&& apt-get install patchelf -y \
&& add-apt-repository ppa:deadsnakes/ppa -y \
&& apt update \
&& apt install python3.10 -y \
&& apt install python3.10-distutils -y \
&& apt install python3-pip -y \
&& apt install python3.10-tk -y \
&& apt install -y upx \
&& apt-get install patchelf -y \
&& apt-get install ccache -y \
&& apt-get install -y libxcb-xinerama0 \
&& apt-get install -y libgtk-3-0 \
&& apt-get install qt6-qpa-plugins -y \
&& apt-get install libgl1-mesa-glx libglib2.0-0 libsm6 libxext6 libxrender-dev libxcb-xinerama0 -y \
&& apt-get install -y qt6-base-dev \
&& rm -rf /var/lib/apt/lists/ \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 \
&& rm -rf /var/lib/apt/lists/*
FROM base_image as install_requirements
USER root
WORKDIR /app
ENV XFORMERS_MORE_DETAILS=1
RUN pip install nvidia-pyindex
WORKDIR /app
RUN pip install --upgrade pip
RUN pip install --upgrade setuptools
RUN pip install --upgrade wheel
RUN pip install aihandler
RUN pip install accelerate
RUN pip install requests
FROM install_requirements as fix_tcl
USER root
RUN ln -s /usr/share/tcltk/tcl8.6 /usr/share/tcltk/tcl8
FROM fix_tcl as install_apps
COPY build.sh build.sh
COPY build.py build.py
COPY build.chatairunner.linux.prod.spec build.chatai.linux.prod.spec
COPY linux.itch.toml linux.itch.toml
COPY src/chatairunner/v1.yaml v1.yaml
COPY src/chatairunner/v2.yaml v2.yaml
COPY src/chatairunner/pyqt src/chatairunner/pyqt
RUN python3 -c "from accelerate.utils import write_basic_config; write_basic_config(mixed_precision='fp16')"
RUN pip uninstall nvidia-cublas-cu11 -y
FROM install_apps as more_env
ENV PATH="/usr/local/lib/python3.10:/usr/local/lib/python3.10/bin:${PATH}"
ENV PYTHONPATH="/usr/local/lib/python3.10:/usr/local/lib/python3.10/bin:${PYTHONPATH}"
RUN pip install pyinstaller
RUN pip install bitsandbytes-cuda102