Deployment Guide

Deployment Guide

Ship SentinelGrid to Vercel, Docker, or your own infrastructure.

Deployment Guide

SentinelGrid is a standard Next.js 16 app, so it deploys anywhere Next.js runs. This guide covers Vercel (one-click), Docker (self-hosted), and custom domain setup.

Build Steps

Build the production bundle locally to verify everything compiles before deploying:

Production build
# Install dependencies
bun install

# Run linters
bun run lint

# Push Prisma schema
bun run db:push

# Build the production bundle
bun run build

# Start the production server (port 3000)
bun run start

Database

SentinelGrid ships with SQLite by default. For production, switch the Prisma datasource to Postgres or MySQL by updating prisma/schema.prisma and the DATABASE_URL environment variable.

Environment Variables

SentinelGrid reads the following environment variables. Copy .env.example to .env and fill in the values.

.env
# Database
DATABASE_URL="file:./prisma/dev.db"

# Auth (NextAuth.js)
NEXTAUTH_URL="https://your-domain.com"
NEXTAUTH_SECRET="generate-with-openssl-rand-base64-32"

# OAuth providers (optional)
GITHUB_CLIENT_ID=""
GITHUB_CLIENT_SECRET=""
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""

# External API (when swapping mock data for real backend)
API_URL="https://api.your-domain.com"
API_TOKEN=""

# Observability
SENTRY_DSN=""
VERCEL_ANALYTICS_ID=""

Required for production

  • DATABASE_URL — Postgres connection string recommended
  • NEXTAUTH_SECRET — Generate with openssl rand -base64 32
  • NEXTAUTH_URL — Your canonical production URL

Vercel Deployment

Vercel is the recommended deployment target. The Next.js runtime is tuned for the Vercel edge network, and the dashboard preview deployments are perfect for staging.

CLI deployment
# Install the Vercel CLI
npm i -g vercel

# Log in
vercel login

# Deploy from the project root
vercel

# Promote to production
vercel --prod

Or connect the repository on the Vercel dashboard and enable auto-deploys on push to main.

Vercel + Prisma

Add a build command that runs prisma generate before next build. Vercel will pick up the postinstall script in package.json automatically if you add "postinstall": "prisma generate".

Docker Deployment

SentinelGrid ships with a multi-stage Dockerfile optimized for the Next.js standalone output. Build and run with:

Dockerfile
# ---- Dependencies ----
FROM node:20-alpine AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci

# ---- Build ----
FROM node:20-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npx prisma generate
RUN npm run build

# ---- Runner ----
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/prisma ./prisma
EXPOSE 3000
ENV PORT=3000
CMD ["node", "server.js"]
Build and run
# Build the image
docker build -t sentinelgrid .

# Run on port 3000 with env file
docker run -p 3000:3000 --env-file .env --name sentinelgrid sentinelgrid

Standalone output

Enable standalone output in next.config.ts: output: "standalone". This bundles only the files needed to run the server, shrinking the image to ~150MB.

Custom Domain

On Vercel, navigate to Project Settings → Domains and add your domain. Vercel handles SSL certificate provisioning automatically.

For self-hosted deployments, terminate TLS with Caddy, Nginx, or your load balancer. SentinelGrid ships with a sample Caddyfile:

Caddyfile
your-domain.com {
  reverse_proxy localhost:3000
  encode gzip zstd
  header {
    Strict-Transport-Security "max-age=31536000; includeSubDomains"
    X-Content-Type-Options nosniff
    X-Frame-Options DENY
  }
}

Pre-Deployment Checklist

  • Lint passes (bun run lint)
  • Production build succeeds (bun run build)
  • DATABASE_URL points to production database
  • NEXTAUTH_SECRET is set and >= 32 chars
  • OAuth providers configured (if used)
  • CSP headers and HSTS enabled
  • Error tracking (Sentry) wired up
  • Analytics (Vercel Analytics) enabled

Command Palette

Search for a command to run...