Spaces:
Paused
Paused
Commit ·
3ca89c8
1
Parent(s): bfc23db
Deploy Minimal Web Terminal
Browse files- Dockerfile +26 -0
Dockerfile
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Minimal Web Terminal payload for Hugging Face Free Tier
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# Avoid prompts during apt installs
|
| 5 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
+
|
| 7 |
+
# 1. Install bare minimum dependencies (No FUSE/SSHFS to avoid 503 crash)
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
wget \
|
| 10 |
+
curl \
|
| 11 |
+
bash \
|
| 12 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
+
|
| 14 |
+
# 2. Install ttyd directly from binary
|
| 15 |
+
RUN wget -O /usr/bin/ttyd https://github.com/tsl0922/ttyd/releases/download/1.7.4/ttyd.x86_64 && \
|
| 16 |
+
chmod +x /usr/bin/ttyd
|
| 17 |
+
|
| 18 |
+
# 3. Create non-root user (Required by Hugging Face)
|
| 19 |
+
RUN useradd -m -u 1000 user
|
| 20 |
+
USER user
|
| 21 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 22 |
+
|
| 23 |
+
WORKDIR /app
|
| 24 |
+
|
| 25 |
+
# 4. Start ttyd on port 7860 to provide an interactive bash terminal
|
| 26 |
+
CMD ["ttyd", "-p", "7860", "-W", "bash"]
|