Deployment
Deploying the Docs Site
The docs site (packages/docs) builds to static HTML using VitePress. It can be hosted on any static hosting provider.
Railway (Recommended)
Since you're already hosting the landing page on Railway, the docs site fits naturally there too.
Option 1: Nixpacks (Auto-detect)
Railway auto-detects Node.js projects. Create a new Railway service pointed at the monorepo:
- Create a new service in your Railway project
- Connect your GitHub repo
- Set the Root Directory to
packages/docs - Set the Build Command:
npm install -g pnpm && pnpm install && pnpm build - Set the Start Command:
npx serve .vitepress/dist -l 3000 - Add custom domain:
docs.trenchtools.io
Option 2: Dockerfile
Create a Dockerfile in packages/docs/:
dockerfile
FROM node:20-alpine AS build
RUN npm install -g pnpm
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install
COPY . .
RUN pnpm build
FROM nginx:alpine
COPY --from=build /app/.vitepress/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]Then in Railway:
- Create a new service → Dockerfile
- Set root directory to
packages/docs - Railway builds and deploys the nginx container
- Add custom domain:
docs.trenchtools.io
Option 3: Static Site Deploy
bash
cd packages/docs
pnpm install
pnpm build
# Upload .vitepress/dist/ to Railway as a static siteDNS Setup
Point docs.trenchtools.io to Railway:
- In Railway, add the custom domain to your docs service
- Railway provides a CNAME target (e.g.,
xxx.up.railway.app) - In your DNS provider, add:
CNAME docs → xxx.up.railway.app - Wait for DNS propagation and SSL provisioning
Alternative Hosts
VitePress outputs static HTML, so it works on:
- Vercel: Zero-config with framework detection
- Netlify: Drop the
distfolder or connect repo - Cloudflare Pages: Free, fast global CDN
- GitHub Pages: Free for public repos
Deploying the UI
The main dashboard (packages/ui) also builds to static files:
bash
npx turbo run build --filter=@trenchtools/ui --force
# Output: packages/ui/dist/This can be hosted the same way, but since TrenchTools is self-hosted by design, most users will run pnpm start locally.
Environment Variables
For the docs site, no environment variables are needed — it's pure static content.
For the UI, if hosting publicly:
env
VITE_DEFAULT_RPC_URL=https://api.mainnet-beta.solana.com
VITE_JUPITER_API_KEY=your-key-here