Spaces:
Sleeping
Sleeping
FROM nvidia/cuda:11.3.1-base-ubuntu20.04 | |
ENV DEBIAN_FRONTEND=noninteractive \ | |
TZ=Europe/Paris | |
# Remove any third-party apt sources to avoid issues with expiring keys. | |
# Install some basic utilities | |
RUN rm -f /etc/apt/sources.list.d/*.list && \ | |
apt-get update && apt-get install -y --no-install-recommends \ | |
curl \ | |
ca-certificates \ | |
sudo \ | |
git \ | |
wget \ | |
procps \ | |
git-lfs \ | |
zip \ | |
unzip \ | |
htop \ | |
vim \ | |
nano \ | |
bzip2 \ | |
libx11-6 \ | |
build-essential \ | |
libsndfile-dev \ | |
software-properties-common \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN add-apt-repository ppa:flexiondotorg/nvtop && \ | |
apt-get upgrade -y && \ | |
apt-get install -y --no-install-recommends nvtop | |
RUN apt install -y python3 | |
RUN apt install -y python3-pip | |
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \ | |
apt-get install -y nodejs && \ | |
npm install -g configurable-http-proxy | |
WORKDIR /app | |
# Create a non-root user and switch to it | |
RUN adduser --disabled-password --gecos '' --shell /bin/bash user \ | |
&& chown -R user:user /app | |
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user | |
USER user | |
# All users can use /home/user as their home directory | |
ENV HOME=/home/user | |
RUN mkdir $HOME/.cache $HOME/.config \ | |
&& chmod -R 777 $HOME | |
WORKDIR $HOME/app | |
COPY requirements.txt ./ | |
RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
COPY . . | |
EXPOSE 7860 | |
CMD ["python","./manage.py","runserver","0.0.0.0:7860"] |