t3code icon indicating copy to clipboard operation
t3code copied to clipboard

feat(server): add headless Docker image

Open moenzuel opened this issue 4 months ago • 2 comments

Problem

Running the published T3 server in a fresh container requires downloading the package and compiling native dependencies at startup. Keeping that compiler toolchain in the runtime image also makes a headless deployment larger and less predictable.

Solution

  • Add a multi-stage Dockerfile that installs the published T3 package during the image build.
  • Support an exact T3_VERSION build argument while defaulting local builds to latest.
  • Keep compilers in the builder stage and run the server as the non-root node user behind tini.
  • Persist T3 state and the workspace through dedicated volumes.
  • Document build, run, persistence, and provider CLI requirements in the remote-access guide.

Impact

Users can build a repeatable headless T3 server image that starts without an npm download. Provider CLIs and credentials remain an explicit deployment choice rather than being baked into the base image.

Validation

  • docker build --check --build-arg T3_VERSION=0.0.31 .
  • docker build --build-arg T3_VERSION=0.0.31 --tag t3-pr-smoke:local .
  • Confirmed the image reports t3 v0.0.31, reaches the ready state, and serves the web UI on port 3773.
  • vp fmt --check docs/user/remote-access.md

Built with GPT-5.6 using the Codex harness in T3 Code.

[!NOTE]

Add headless Docker image for t3 serve

  • Adds a multi-stage Dockerfile: a build stage installs the t3 npm package into /opt/t3, and the final stage (based on node:24-bookworm-slim) runs t3 serve bound to 0.0.0.0:3773 with /workspace as the served path and /data as the data volume.
  • Supports a T3_VERSION build arg (default: latest) for reproducible builds.
  • Adds a Docker section to the remote access docs covering build, run, and volume/port mapping. Notes that provider CLIs and credentials must be added via a derived image.

Macroscope summarized 4caec2c.


[!NOTE] Low Risk Packaging and documentation only; no changes to server auth, pairing, or runtime application code paths.

Overview Adds a multi-stage Dockerfile so the published t3 package is installed at image build (with optional T3_VERSION), keeping compilers out of the runtime image. The final image runs as the node user with tini, exposes 3773, sets T3CODE_HOME=/data, and defaults to t3 serve on 0.0.0.0 with /workspace as the served cwd and /data + /workspace as volumes.

The remote access guide now documents build, run, volume/port mapping, and that provider CLIs and credentials are not in the base image and must be added in a derived image.

Reviewed by Cursor Bugbot for commit 4caec2c06268120c4ec8ee52282cb373b8a9a215. Bugbot is set up for automated code reviews on this repo. Configure here.

moenzuel avatar Jul 30 '26 03:07 moenzuel

[!IMPORTANT]

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f38ed540-8e85-4d4a-a58d-404e0175214d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • [ ] 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot] avatar Jul 30 '26 03:07 coderabbitai[bot]

Approvability

Verdict: Needs human review

This PR adds new Docker deployment capability and changes the auto-bootstrap configuration precedence to allow explicit opt-in during headless mode. New features with runtime behavior changes warrant human review. There's also an unresolved comment about Docker networking causing unreachable pairing URLs.

You can customize Macroscope's approvability policy. Learn more.

macroscopeapp[bot] avatar Jul 30 '26 04:07 macroscopeapp[bot]

[!NOTE] 🤖 GPT-5.6 Sol responding on behalf of Theo

Closing this PR after an automated pass over open pull requests. Adds a new unsupported distribution or deployment system that increases ongoing maintenance.

t3dotgg avatar Aug 23 '26 11:08 t3dotgg