From 4f8032664da46dc7e7d91637d6781dd84f623d22 Mon Sep 17 00:00:00 2001 From: lordspline Date: Fri, 12 Sep 2025 00:01:56 +0000 Subject: [PATCH] =?UTF-8?q?Capy=20jam:=20integrate=20ttyd=20via=20Dockerfi?= =?UTF-8?q?le=20and=20CodeSandbox=20tasks=20for=20universal=20template=20?= =?UTF-8?q?=E2=80=94=20install=20static=20binary=20and=20auto-start=20on?= =?UTF-8?q?=20port=203010=20alongside=20FastAPI;=20avoid=20touching=20app?= =?UTF-8?q?=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Capy --- universal/.codesandbox/tasks.json | 7 +++++++ universal/.devcontainer/Dockerfile | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/universal/.codesandbox/tasks.json b/universal/.codesandbox/tasks.json index 56f17e6e9..e13e53070 100644 --- a/universal/.codesandbox/tasks.json +++ b/universal/.codesandbox/tasks.json @@ -24,6 +24,13 @@ "resume": false } }, + "ttyd": { + "name": "start web terminal (ttyd)", + "command": "/usr/local/bin/ttyd -p 3010 bash", + "runAtStart": true, + "preview": { "port": 3010 }, + "restartOn": { "clone": false, "resume": false } + }, "code-server": { "name": "start code-server", "command": "code-server --bind-addr 0.0.0.0:8080 --auth none /project/workspace", diff --git a/universal/.devcontainer/Dockerfile b/universal/.devcontainer/Dockerfile index 8536cc736..1290ecd75 100644 --- a/universal/.devcontainer/Dockerfile +++ b/universal/.devcontainer/Dockerfile @@ -52,6 +52,11 @@ RUN apt update && \ # Install code-server RUN curl -fsSL https://code-server.dev/install.sh | sh +# Install ttyd (web terminal) - V1: linux/amd64 only +# TODO: Add ARM64 support (alternate binary URL/detection) +RUN curl -fsSL https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.x86_64 -o /usr/local/bin/ttyd \ + && chmod +x /usr/local/bin/ttyd + # The project will be mounted in /workspace by default # Every new shell will open inside the built container