-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
62 lines (51 loc) · 1.77 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
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /home/models
# Install dependencies
RUN apt-get update && apt-get install -y \
openssh-server \
curl \
wget \
fail2ban \
software-properties-common \
apt-transport-https \
ca-certificates \
gnupg-agent \
python3 \
python3-venv \
libgl1 \
libglib2.0-0 \
lshw \
sudo \
pip \
make \
libtcmalloc-minimal4 \
apt-utils \
htop \
gdu
# Install Docker
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \
apt-get update && \
apt-get install -y docker-ce docker-ce-cli containerd.io
# Setup SSH
RUN mkdir /var/run/sshd
RUN echo 'root:root' | chpasswd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
# Install Conda
RUN wget https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-x86_64.sh && \
bash Anaconda3-2023.09-0-Linux-x86_64.sh -b -p /anaconda && \
rm Anaconda3-2023.09-0-Linux-x86_64.sh
ENV PATH="/home/models/.local/bin:/anaconda/bin:${PATH}"
ENV PATH="/anaconda/bin:${PATH}"
RUN echo "source /anaconda/etc/profile.d/conda.sh" >> /etc/profile
RUN useradd -m -s /bin/bash models && echo "models:root" | chpasswd && adduser models sudo
RUN echo 'models ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
COPY ./Makefile /home/models/ollama
COPY ./Makefile /home/models/diffusion
COPY ./Makefile /home/models/fooocus
EXPOSE 22 2375
CMD ["sh", "-c", "service ssh start && tail -f /dev/null"]