File size: 1,089 Bytes
feba30b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04

ENV DEBIAN_FRONTEND=noninteractive 
ENV TZ=Europe/Paris

# Install some basic utilities
RUN rm -f /etc/apt/sources.list.d/*.list && \
    apt-get update && apt-get install -y \
    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 \
 && rm -rf /var/lib/apt/lists/*


 
# 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

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

WORKDIR $HOME/app

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

COPY --chown=chatbot . $HOME/app

RUN chmod +x start_chatbot.sh