# docker-deployment

A skill that walks a Node.js app through containerization: Dockerfile, multi-stage builds, Docker Compose and a production-ready image.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 523 installs · ★ 2
- Author: pluginagentmarketplace
- License: LicenseRef-Proprietary · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pluginagentmarketplace/custom-plugin-nodejs/tree/HEAD/skills/docker-deployment/SKILL.md
- Updated: 2026-01-07
- HTML: https://affpapa.org/en/nevibecode/skills/docker-deployment

## What it does

The skill covers the whole path from a first Dockerfile to a production build. It starts with `node:18-alpine`, installs dependencies via `npm ci --only=production`, then splits the build into stages so `node_modules` is copied from the builder. The final image runs as the non-root `nodejs` user and ships a `HEALTHCHECK`.

A ready `docker-compose.yml` wires the app to `postgres:15-alpine`, `redis:7-alpine` and nginx, with commands for `docker-compose up -d`, following logs, tearing down and scaling the app service. There are also sections on `.dockerignore`, environment variables through `ENV`, `environment` and `env_file`, volumes for logs and `node_modules`, pushing to Docker Hub, and a GitHub Actions workflow that builds and pushes the image.

Two failure modes get their own write-up: layer caching for `node_modules` and `SIGTERM` handling, because without the latter a container will not shut down cleanly. That is why the examples put `node` in `CMD` instead of `npm start`. You need Docker installed and a Node.js project with a `package.json`; the image tags and port 3000 in the examples are placeholders for your own setup.

## Requirements
- Works with: Docker

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-nodejs --skill docker-deployment -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/docker-deployment/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/docker-deployment/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-nodejs --skill docker-deployment -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/docker-deployment/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-nodejs --skill docker-deployment -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/docker-deployment/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pluginagentmarketplace/custom-plugin-nodejs docker-deployment
```

2. **Manually: put the files in place**
- File: `.github/skills/docker-deployment/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-nodejs --skill docker-deployment -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pluginagentmarketplace/custom-plugin-nodejs --path skills/docker-deployment
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/docker-deployment/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-nodejs --skill docker-deployment -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/pluginagentmarketplace/custom-plugin-nodejs/tree/HEAD/skills/docker-deployment/SKILL.md

## When to use it
- write a Dockerfile for a Node.js service from scratch
- shrink a production image with a multi-stage build
- run the app alongside Postgres, Redis and nginx from one `docker-compose.yml`
- add a healthcheck and stop running the container as root
- push an image to Docker Hub from a GitHub Actions workflow

## Example prompts
- write a multi-stage Dockerfile for my Node.js app
- add app, db and redis services with volumes to docker-compose.yml
- why does my container ignore SIGTERM on shutdown?

## Similar
- [adding-docker](https://affpapa.org/en/nevibecode/skills/adding-docker.md) — skill · 398 installs
- [docker](https://affpapa.org/en/nevibecode/skills/docker.md) — skill · 2900 installs
- [docker-compose-patterns](https://affpapa.org/en/nevibecode/skills/docker-compose-patterns.md) — skill · 1400 installs
- [docker-project-foundations](https://affpapa.org/en/nevibecode/skills/docker-project-foundations.md) — skill · 1000 installs
- [bun-docker](https://affpapa.org/en/nevibecode/skills/bun-docker.md) — skill · 408 installs
- [docker-patterns](https://affpapa.org/en/nevibecode/skills/docker-patterns.md) — skill · 6400 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
