-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (39 loc) · 1.64 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
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
ARG TORCH
ARG PYTHON_VERSION
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
ENV SHELL=/bin/bash
# Set the working directory
WORKDIR /
# Update, upgrade, install packages and clean up
RUN apt-get update --yes && \
apt-get upgrade --yes && \
apt install --yes --no-install-recommends git wget curl bash libgl1 software-properties-common openssh-server nginx && \
add-apt-repository ppa:deadsnakes/ppa && \
apt install "python${PYTHON_VERSION}-dev" "python${PYTHON_VERSION}-venv" -y --no-install-recommends && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
# Set up Python and pip
RUN ln -s /usr/bin/python${PYTHON_VERSION} /usr/bin/python && \
rm /usr/bin/python3 && \
ln -s /usr/bin/python${PYTHON_VERSION} /usr/bin/python3 && \
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python get-pip.py
RUN pip install --upgrade --no-cache-dir pip
RUN pip install --upgrade --no-cache-dir ${TORCH}
# Remove existing SSH host keys
RUN rm -f /etc/ssh/ssh_host_*
# NGINX Proxy
COPY --from=proxy nginx.conf /etc/nginx/nginx.conf
COPY --from=proxy nginx-default /etc/nginx/sites-enabled/default
COPY --from=proxy readme.html /usr/share/nginx/html/readme.html
# Copy the README.md
COPY README.md /usr/share/nginx/html/README.md
# Start Scripts
COPY --from=proxy start.sh post_start.sh webui-user.sh webui.sh error_catch_all.sh /
RUN chmod +x /start.sh && chmod +x /post_start.sh && chmod +x /webui.sh
# Set the default command for the container
CMD [ "/start.sh" ]