create-better-t-stack Docker & Self-Hosted Deployment

GitHub

A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations

5,349 stars TypeScript TypeScript 1 file ยท ~1,654 tokens #better-auth#bun#clack-prompt#cli#drizzle-orm#expo#fumadocs#hono
1. Pull Image (DOCKERHUB) docker pull AmanVarshney01/create-better-t-stack:latest
2. Docker Run (1-Click Launch) docker run -d --name create-better-t-stack -p 3001:3001 --restart always amanvarshney01/create-better-t-stack:latest
3. Podman Run podman run -d --name create-better-t-stack -p 3001:3001 --restart always amanvarshney01/create-better-t-stack:latest
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/amanvarshney01/create-better-t-stack:latest
5. ORAS Pull (OCI Artifact) oras pull amanvarshney01/create-better-t-stack:latest
packages/template-generator/templates/deploy/docker/web/svelte/Dockerfile.hbs
FROM node:24{{#unless (includes addons "vite-plus")}}-slim{{/unless}} AS base
{{#if (eq packageManager "bun")}}
COPY --from=oven/bun:1 /usr/local/bin/bun /usr/local/bin/bun
{{/if}}
{{#if (eq packageManager "pnpm")}}
RUN npm install -g pnpm@11
{{/if}}
WORKDIR /app

COPY . .
{{#if (eq packageManager "bun")}}
RUN --mount=type=secret,id=web_env,target=/app/apps/web/.env.local --mount=type=secret,id=server_env,target=/app/apps/server/.env.local --mount=type=cache,target=/root/.bun/install/cache bun install
{{else if (eq packageManager "pnpm")}}
RUN --mount=type=secret,id=web_env,target=/app/apps/web/.env.local --mount=type=secret,id=server_env,target=/app/apps/server/.env.local --mount=type=cache,target=/pnpm-store pnpm install --store-dir /pnpm-store
{{else}}
RUN --mount=type=secret,id=web_env,target=/app/apps/web/.env.local --mount=type=secret,id=server_env,target=/app/apps/server/.env.local --mount=type=cache,target=/root/.npm npm install
{{/if}}

{{#if (and (ne backend "self") (ne backend "none") (ne backend "convex"))}}
ARG PUBLIC_SERVER_URL
ENV PUBLIC_SERVER_URL=${PUBLIC_SERVER_URL}
{{/if}}
{{#if (eq backend "convex")}}
ARG PUBLIC_CONVEX_URL
ENV PUBLIC_CONVEX_URL=${PUBLIC_CONVEX_URL}
{{/if}}
# SvelteKit 3 reads ORIGIN when the app is built (vite.config.ts `paths.origin`), not at
# runtime. Pass it as a build argument; setting it with `docker run -e` has no effect.
ARG ORIGIN=http://localhost:3001
ENV ORIGIN=${ORIGIN}
ENV NODE_ENV=production
{{#if (and (eq backend "self") (eq database "sqlite") (eq dbSetup "none"))}}
RUN mkdir -p /app/.data
{{/if}}
RUN --mount=type=secret,id=web_env,target=/app/apps/web/.env.local --mount=type=secret,id=server_env,target=/app/apps/server/.env.local cd apps/web && {{packageManager}} run build
{{#if (eq orm "prisma")}}
ENV DATABASE_URL=
{{/if}}

ENV HOST=0.0.0.0
ENV PORT=3001
EXPOSE 3001

WORKDIR /app/apps/web
CMD ["node", "build/index.js"]