Spaces:
Sleeping
Sleeping
File size: 1,015 Bytes
5598804 66ca2ed 5598804 66ca2ed d8cbd07 5598804 d8cbd07 5598804 d8cbd07 5598804 66ca2ed d8cbd07 66ca2ed d8cbd07 5598804 d8cbd07 5598804 d8cbd07 5598804 66ca2ed d8cbd07 | 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 | FROM python:3.9
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y \
curl \
wget \
git \
nano \
vim \
net-tools \
sudo \
ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Install ttyd from prebuilt binary
RUN wget -q https://github.com/tsl0922/ttyd/releases/download/1.7.3/ttyd.x86_64 \
-O /usr/local/bin/ttyd && \
chmod +x /usr/local/bin/ttyd
# Create a non-root user with a password
RUN useradd -m -u 1000 -s /bin/bash user && \
echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/user && \
echo "user:devpassword" | chpasswd
# Nice terminal prompt + welcome message
RUN echo 'export PS1="\[\033[1;32m\]\u@hf-space\[\033[0m\]:\[\033[1;34m\]\w\[\033[0m\]\$ "' \
>> /home/user/.bashrc && \
echo 'echo "🟢 Welcome to your HF Dev Space!"' \
>> /home/user/.bashrc
WORKDIR /app
COPY . /app
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 7860
CMD ["/entrypoint.sh"]
|