docker-deployment

Project-specific rules for running TT Studio with Docker, a tool that packages applications into isolated containers. They describe its frontend, backend, model-inference service, hardware access, setup script, and required environment settings.

In plain words
What is it for?
Use them to start development or production environments, configure secrets and service tokens, initialize components, mount hardware, and stop or clean up the Docker services.
Why use it?
They reduce setup and deployment mistakes in a project that runs several services and needs access to Tenstorrent hardware.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/tenstorrent/tt-studio/docker-deployment
Clone the repo
git clone --depth 1 https://github.com/tenstorrent/tt-studio

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 825 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00825
Opus 5 $0.00000 $0.00413
Sonnet 5 $0.00000 $0.00165
Haiku 4.5 $0.00000 $0.00082

Measured 2d ago against content hash c7e3e6c1f1bf, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

docker-deployment scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/docker-deployment.mdc · 146 lines

How it starts

The opening of the file, as written. The whole thing — 146 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Docker & Deployment Rules

Rules for containerization, deployment, and infrastructure management in TT Studio.

Deployment Architecture

TT Studio uses a multi-container architecture:

  • Frontend Container: React app served via Vite
  • Backend Container: Django REST API
  • TT Inference Server: FastAPI model inference service
  • Hardware Integration: Automatic /dev/tenstorrent mounting

Setup Script (run.py) Guidelines

The run.py script is the primary interface for TT Studio management:

Core Functionality

  • Automatic submodule initialization and management
  • Environment variable configuration and validation
  • Docker container orchestration
  • Hardware detection and integration
  • Development and production mode support

Environment Variables

Required variables that must be configured:

  • JWT_SECRET: Authentication token secret
  • HF_TOKEN: Hugging Face API token for model access
  • DJANGO_SECRET_KEY: Django security key
  • TAVILY_API_KEY: Search functionality (optional)

Command Patterns

# Standard setup
python run.py

# Development mode with live reload
python run.py --dev

# Cleanup containers and services
python run.py --stop

Docker Best Practices

Container Design

  • Use multi-stage builds for optimization
  • Implement proper health checks
  • Handle graceful shutdown signals
  • Mount only necessary volumes

Hardware Integration

  • Automatically detect Tenstorrent devices
  • Mount /dev/tenstorrent when available
  • Provide fallback behavior for missing hardware
  • Handle device permissions correctly

Development Mode

  • Mount source code volumes for live reload
  • Support hot reloading for both frontend and backend
  • Maintain development dependencies in separate layers
  • Enable debug modes and logging

Production Mode

  • Optimize container sizes
  • Use production-ready web servers
  • Implement proper logging and monitoring
  • Handle environment-specific configurations

Port Management

Standard port allocation:

  • Frontend: 3000 (Vite dev server)
  • TT Inference Server: 8001 (FastAPI)
  • Backend: Integrated with frontend container

Read the full file on GitHub · 146 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 146 lines · 0 tokens per session scan A c7e3e6c1f1bf

Subscribe to this mod's changes

docker-deployment is a cursor rule published in the GitHub repository tenstorrent/tt-studio (49 stars, last pushed 4d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 825 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.