File size: 1,944 Bytes
8bb21dd
feba30b
8bb21dd
feba30b
 
 
e469db9
feba30b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7fa050d
 
 
feba30b
 
1c2ba78
 
8bb21dd
 
feba30b
e469db9
a13ac3e
 
0561241
a13ac3e
1c2ba78
feba30b
 
 
 
 
 
 
 
 
68a97d2
 
 
 
 
97992cb
feba30b
 
 
97992cb
b002858
feba30b
b002858
97992cb
feba30b
b002858
feba30b
39c827a
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
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04

ENV DEBIAN_FRONTEND=noninteractive  TZ=Europe/Paris TERM=linux

# Install some basic utilities
RUN rm -f /etc/apt/sources.list.d/*.list && \
    apt-get update && apt-get install -y -qq \
    curl \
    ca-certificates \
    sudo \
    git \
    git-lfs \
    zip \
    unzip \
    htop \
    bzip2 \
    libx11-6 \
    build-essential \
    libsndfile-dev \
    software-properties-common \
    gcc \
    wget \
    python3-dev \
    python3-pip \
    python3-setuptools \
    python3-wheel \
    python3-venv \
 && rm -rf /var/lib/apt/lists/*

ENV PATH="/home/chatbot/.local/bin:${PATH}"

#RUN wget -q https://developer.download.nvidia.com/compute/cuda/12.4.1/local_installers/cuda_12.4.1_550.54.15_linux.run
# \ && sudo /bin/bash cuda_12.4.1_550.54.15_linux.run

RUN wget -q https://developer.download.nvidia.com/compute/cudnn/9.1.1/local_installers/cudnn-local-repo-ubuntu2204-9.1.1_1.0-1_amd64.deb \
    && sudo dpkg -i cudnn-local-repo-ubuntu2204-9.1.1_1.0-1_amd64.deb \
    && sudo cp /var/cudnn-local-repo-ubuntu2204-9.1.1/cudnn-*-keyring.gpg /usr/share/keyrings/ \
    && sudo apt-get update && sudo apt-get -y install cudnn 

# Create a working directory
WORKDIR /app

# Create a non-root user and switch to it
RUN adduser --disabled-password --gecos '' --shell /bin/bash chatbot && chown -R chatbot:chatbot /app

RUN echo "chatbot ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-chatbot

USER chatbot

# Set HOME env variable
ENV HOME=/home/chatbot
# Create the .cache and .config directories and set permissions
RUN mkdir $HOME/.cache $HOME/.config && chmod -R 777 $HOME

RUN --mount=target=requirements.txt,source=requirements.txt pip install --no-cache-dir --upgrade -r requirements.txt

WORKDIR $HOME/app

USER root

RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite bash /root/on_startup.sh

USER chatbot

COPY --chown=chatbot src src

RUN chmod +x src/start_chatbot.sh