docmd generates a high-performance static website. Run the build command to generate the output directory:
docmd build
The output is a self-contained site/ folder (or whatever you’ve configured as out in your config) that can be hosted anywhere.
One-Command Deployment
docmd deploy reads your docmd.config.js and generates deployment files personalised to your project — no generic templates.
Instead of manually writing Dockerfiles and server configs, let docmd generate them for you:
docmd deploy --docker # Dockerfile + .dockerignore
docmd deploy --nginx # Production nginx.conf
docmd deploy --caddy # Production Caddyfile
What Gets Personalised
The deploy command reads your configuration (or zero-config defaults) and injects:
| Config Field | Used In |
|---|---|
title |
Comment headers in every generated file |
out |
COPY paths in Dockerfile, root directives in Nginx/Caddy |
url |
server_name in Nginx, site address in Caddy |
layout.spa |
Controls whether SPA routing fallback is included |
| Config file path | Dockerfile build step uses --config when non-default |
No docmd.config.js? No problem — the command uses the same zero-config defaults as docmd dev and docmd build.
Always In Sync
Every run regenerates your deployment files to match your current config. Changed your site URL or output directory? Just re-run the deploy command — no need to manually track what changed.
Use --force only if you intentionally want to suppress any future confirmation prompts. By default, files are silently regenerated.
Supported Targets
docmd deploy --docker— Optimised multi-stage Dockerfile with layer caching and version pinning.docmd deploy --nginx— Security-hardened nginx.conf with GZIP and immutable asset caching.docmd deploy --caddy— HTTPS-ready Caddyfile with automatic routing.
Click each target above for detailed, service-specific documentation.
(Cloud deployment targets like --vercel and --netlify are planned for a future release.)
Cloud Hosting & CI/CD
If you prefer managed hosting over self-hosted servers, deploy your output folder directly to GitHub Pages, Vercel, Netlify, or Cloudflare Pages.
See the CI/CD Deployment Guide for automated workflows.
SPA Routing
docmd implements a micro-SPA router for smooth internal navigation. Every page is generated as its own index.html file, so:
- No rewrite rules needed — direct URL access works because
/guide/setupresolves to/guide/setup/index.html. - Deep linking works — out of the box, on every hosting platform.
When layout.spa is set to false in your config, the deploy command omits SPA fallback routing from generated server configs.
Production Checklist
- Site URL: Set the
urlproperty indocmd.config.js— this drives canonical tags, sitemaps, social previews, and deployment file generation. - Redirects: Migrating from another tool? Use the
redirectsconfig to preserve SEO rankings. - Analytics: Enable the
analyticsplugin to track engagement and search queries. - AI Context: Enable the
llmsplugin to generatellms.txtfor AI agent ingestion.
docmd generates a 404.html in your output directory. Most hosting providers automatically serve this for missing routes.