Skip to content
OpenAgentSkill
Browsing is open · Catalog captured 2026-11-21 · Automatic updates and account services are paused.
DevOps & cloud

ai-assist-dockerize-website

Guide the user through containerizing and serving a simple website or documentation folder with Docker — inspects the project to detect what to serve (ready-to-serve static HTML, a buildable site that emits static output, or a raw markdown/docs folder that needs rendering), generates a Dockerfile, .dockerignore, docker-compose.yml, helper run/build commands, and a 'Running with Docker' README section, then offers to build and smoke-test the container and publish the image to Docker Hub or GHCR. Uses nginx:alpine for static content and a multi-stage build when the site must be generated. Only invoke when the user explicitly types /ai-assist-dockerize-website. Never auto-trigger from general conversation about Docker, containers, websites, or Dockerfiles.

jparkerweb · AI review on file

Installation

Read the source and dependencies before running a command. Copying does not install or execute anything.

npx skills add jparkerweb/ai-assist-skills --skill ai-assist-dockerize-website

About this skill


name: ai-assist-dockerize-website description: "Guide the user through containerizing and serving a simple website or documentation folder with Docker — inspects the project to detect what to serve (ready-to-serve static HTML, a buildable site that emits static output, or a raw markdown/docs folder that needs rendering), generates a Dockerfile, .dockerignore, docker-compose.yml, helper run/build commands, and a 'Running with Docker' README section, then offers to build and smoke-test the container and publish the image to Docker Hub or GHCR. Uses nginx:alpine for static content and a multi-stage build when the site must be generated. Only invoke when the user explicitly types /ai-assist-dockerize-website. Never auto-trigger from general conversation about Docker, containers, websites, or Dockerfiles." argument-hint: "[path-to-site-or-docs-folder] [--port ]"

Dockerize a Website

This skill is invoked manually — only when the user explicitly runs /ai-assist-dockerize-website. Don't auto-trigger it from general talk about Docker, containers, or websites.

Guide the user from a project folder to a working Docker container that serves their site or documentation. The skill is interactive and guided, not a one-shot script: inspect the project, propose a sensible plan, confirm a few details, generate the files, then offer to build/test and publish.

The spine is: detect → confirm → generate → offer to test → offer to publish. Lead with a good default at every step so the user is confirming, not configuring from scratch.

When to use

Use this whenever the user wants to serve a static website or a documentation folder out of a container — loose HTML/CSS/JS, the build output of a site generator, or a folder of markdown docs. The "project with a docs folder" case is the bullseye.

Out of scope — dynamic apps

This skill serves static content. If the project is a dynamic app that runs code per request — an Express/Fastify/Nest server, Next.js in SSR mode, Flask/Django/FastAPI, a Go/Rust web server, anything with a long-running start/serve process and a port it listens on — stop and say so plainly. Containerizing those means basing the image on the app's own runtime and running its start command, which is a different job. Detect this case (see below), tell the user, and don't half-build a static image that won't actually run their app.

Don't leave them stranded, though. After declining, offer a real next step: a correct container for a dynamic app is based on the app's own runtime (e.g. node:22-alpine), installs its dependencies, runs the start command, and exposes the port the app listens on. Offer to hand-write that separately — it's just outside this skill's static-hosting scope.

Step 1 — Inspect and classify the project

Before asking anything, look at what's there so the proposal is concrete. If the user named a folder (argument or in their message), focus on it; otherwise scan the working directory.

Classify into one of four strategies:

Signals foundStrategy
An index.html ready to serve — at the project root, or in dist/, build/, out/, public/, _site/, site/, www/A · Ready static — single-stage nginx, copy the folder in
Site-generator tooling: package.json with a build script + a static framework (Vite, Astro, Eleventy, Docusaurus, Gatsby, SvelteKit static), or a config file (mkdocs.yml, docusaurus.config.*, astro.config.*, _config.yml, hugo.toml/config.toml, .eleventy.js)B · Buildable — multi-stage build → nginx
A folder of .md docs with no generator configuredC · Raw docs — offer to render (recommended) or serve as-is
A long-running server: package.json start runs a server (node server.js), source calls .listen(), or a web framework (Express, Next SSR, Flask, Django, FastAPI, Go/Rust server)D · Dynamic app — stop, explain, don't build

State your finding in one line — e.g. "Found a built site in dist/ with an index.html, so I'll serve it directly with nginx (strategy A)." — and let the user correct you if the detection is off.

For strategy B and C, the build/render details live in references/recipes.md. Read that file when you land on those paths — it has the multi-stage Dockerfiles per generator (Node SSGs, MkDocs, Hugo, Jekyll), the SPA fallback config, the raw-markdown render path, caching headers, the non-root variant, and a Caddy alternative.

Step 2 — Confirm the details

Pre-fill every answer from Step 1 so these are quick confirmations, not an interrogation:

  • What to serve — the folder (strategy A) or the build output directory (strategy B/C). Show the path you detected.
  • Port — what host port to expose. Default 8080 (avoids clashing with anything already on 80). Honor --port if given.
  • Image / container name — propose one lowercase-hyphenated name for both. Default to the project folder name, but prefer a more meaningful name when one is obvious — a package.json name, or a clear title in the README — e.g. favor marketing-site over a generic folder like app or vite-app. Always let the user override.
  • Compose? — yes by default (one-command up/down). Mention they can skip it.
  • For strategy C, confirm they want the docs rendered (recommended — browsers download raw .md instead of displaying it) versus served as raw files.

Skip questions whose answers are obvious or already given. The user invited a guided flow, not a form.

Step 3 — Generate the artifacts

Generate all of these, tailored to the chosen strategy. Substitute the real folder, port, and names — don't leave placeholders in the files you write.

Dockerfile (strategy A — ready static)

# syntax=docker/dockerfile:1
FROM nginx:1.27-alpine

# Copy the site into nginx's web root.
COPY <SITE_DIR>/ /usr/share/nginx/html/

EXPOSE 80

# Fail the container's health check if nginx stops 
Read the complete source ↗