Download Dockerfile from wpms/terminal: direct link, hf CLI and curl.
- Browser
- Download file 1.17 kB
-
https://huggingface.co/spaces/wpms/terminal/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/wpms/terminal/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/wpms/terminal/resolve/main/Dockerfile
1.17 kB
| FROM ubuntu:22.04 | |
| # Avoid interactive prompts | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| ENV TZ=Asia/Colombo | |
| # Install dependencies including libev | |
| RUN apt-get update && apt-get install -y \ | |
| curl \ | |
| wget \ | |
| git \ | |
| nano \ | |
| vim \ | |
| htop \ | |
| net-tools \ | |
| iputils-ping \ | |
| python3 \ | |
| python3-pip \ | |
| nodejs \ | |
| npm \ | |
| openssh-client \ | |
| ca-certificates \ | |
| gnupg \ | |
| lsb-release \ | |
| software-properties-common \ | |
| libev4 \ | |
| libev-dev \ | |
| libjson-c5 \ | |
| libwebsockets16 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Download and install ttyd binary (pre-built) | |
| RUN curl -L -o /usr/local/bin/ttyd \ | |
| https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.x86_64 \ | |
| && chmod +x /usr/local/bin/ttyd | |
| # Create a non-root user | |
| RUN useradd -m -s /bin/bash terminaluser && \ | |
| echo "terminaluser:terminal123" | chpasswd && \ | |
| usermod -aG sudo terminaluser && \ | |
| echo "terminaluser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | |
| # Set working directory | |
| WORKDIR /home/terminaluser | |
| # Expose port | |
| EXPOSE 7860 | |
| # Start ttyd on port 7860 (Hugging Face default port) | |
| CMD ["ttyd", "-p", "7860", "-c", "terminaluser:terminal123", "bash"] |