discord-bot / Dockerfile
Sébastien De Greef
chore: Add python3-setuptools, python3-wheel, and python3-venv to Dockerfile
7fa050d
raw
history blame
No virus
1.56 kB
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 \
python3-setuptools \
python3-wheel \
python3-venv \
&& rm -rf /var/lib/apt/lists/*
RUN wget 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 cuda 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
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 $HOME/src
RUN chmod +x src/start_chatbot.sh