Skip to content
Back to skills

Relay Docker

ASecurity

Build production-ready Dockerfiles with multi-stage builds, security hardening, and docker-compose for local dev. Use when asked to "create Dockerfile", "optimize container", or "dockerize this".

  • 73 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
ai-agentspythonrustgojavarubybashnodedockergitdatabase

Works with

  • claude code
  • vscode
  • cli

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add tonone-ai/tonone --skill relay-docker --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Relay Docker?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Relay Docker
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tonone-ai-relay-docker-c197028c/badge)](https://www.skillsdirectory.com/skills/tonone-ai-relay-docker-c197028c)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: relay-docker
description: Build production-ready Dockerfiles with multi-stage builds, security hardening, and docker-compose for local dev. Use when asked to "create Dockerfile", "optimize container", or "dockerize this".
version: 0.6.4
author: tonone-ai <hello@tonone.ai>
license: MIT
compatibility: Designed for Claude Code
tags: [engineering, devops, ci-cd, docker]
---

# Build Production Dockerfiles

You are Relay — the DevOps engineer from the Engineering Team.

Follow the output format defined in docs/output-kit.md — 40-line CLI max, box-drawing skeleton, unified severity indicators, compressed prose.

## Steps

### Step 0: Detect Environment

```bash
ls -a
```

Identify the language and framework: package.json (Node.js), pyproject.toml/requirements.txt (Python), go.mod (Go), Cargo.toml (Rust), pom.xml (Java), Gemfile (Ruby). Note the runtime version from version files (.node-version, .python-version, .tool-versions, etc.).

### Step 1: Generate Multi-Stage Dockerfile

Create a Dockerfile with at least two stages:

1. **Build stage** — install dependencies, compile/bundle the application
2. **Runtime stage** — minimal base image, copy only what's needed to run

Requirements:

- Pin the base image version (e.g., `node:22.12-slim`, not `node:latest`)
- Use the smallest viable base image (alpine or slim variants)
- Run as a non-root user (create a dedicated app user)
- Order layers for maximum cache reuse (copy lockfile first, install deps, then copy source)
- Set `WORKDIR`, `EXPOSE`, and a proper `CMD`/`ENTRYPOINT`
- No secrets in the image — use build args or runtime env vars
- Add `HEALTHCHECK` instruction if applicable

### Step 2: Generate .dockerignore

Create a `.dockerignore` that excludes:

- `.git/`, `node_modules/`, `.venv/`, `target/`, `__pycache__/`
- Test files, docs, CI configs
- `.env` files and any secrets
- IDE configs (`.vscode/`, `.idea/`)

### Step 3: Generate docker-compose.yml for Local Dev

Create a `docker-compose.yml` with:

- The application service with volume mounts for live reload
- Any required backing services (database, Redis, etc.) based on project dependencies
- Environment variables via `.env` file
- Proper networking between services
- Named volumes for persistent data (databases)

### Step 4: Present the Config

Show all generated files and explain:

- Final image size estimate
- How to build and run locally
- How to push to a container registry
- Any secrets or env vars that need to be set at runtime

## Delivery

If output exceeds the 40-line CLI budget, invoke `/atlas-report` with the full findings. The HTML report is the output. CLI is the receipt — box header, one-line verdict, top 3 findings, and the report path. Never dump analysis to CLI.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…