Skip to content

Deploy to Production

Build and deploy Admindek to your hosting platform.

Build

Run the following command from the repository root to build all packages. The Next.js output is written to packages/nextjs/.next/:

pnpm build

To build only the Next.js package without rebuilding the entire monorepo, use the filter flag:

pnpm --filter @admindek/nextjs build

Vercel

Vercel is the recommended deployment target for Next.js projects and requires zero configuration beyond pointing it at the correct monorepo subdirectory:

  1. Push your repository to GitHub, GitLab, or Bitbucket.
  2. Import the repository in the Vercel dashboard.
  3. Set the Root Directory to packages/nextjs.
  4. Select Next.js as the framework preset — Vercel auto-detects the build command and output directory.
  5. Click Deploy.

Docker

For self-hosted deployments, containerise the Next.js package with a multi-stage Dockerfile:

FROM node:18-alpine AS base
RUN npm install -g pnpm

FROM base AS deps
WORKDIR /app
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY packages/nextjs/package.json ./packages/nextjs/
COPY packages/core/package.json ./packages/core/
RUN pnpm install --frozen-lockfile

FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN pnpm --filter @admindek/nextjs build

FROM node:18-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
COPY --from=builder /app/packages/nextjs/.next/standalone ./
COPY --from=builder /app/packages/nextjs/.next/static ./.next/static
COPY --from=builder /app/packages/nextjs/public ./public
EXPOSE 3000
CMD ["node", "server.js"]

Netlify

Netlify supports Next.js via the @netlify/plugin-nextjs adapter. Configuration mirrors the Vercel setup:

  • Set Base directory to packages/nextjs
  • Set Build command to cd ../.. && pnpm --filter @admindek/nextjs build
  • Set Publish directory to .next

Environment Variables

The demo ships with no required environment variables — everything runs with mock data out of the box. When integrating a real backend for production, add your own variables (API base URLs, authentication secrets, database connection strings, etc.) through your platform's environment variable UI or a .env.local file during local development.