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"]