What does this skill do?

The Docker Skill provides templates and best practices for Docker and Docker Compose for local development, container security, and the orchestration of multiple services. It includes multi-stage Dockerfiles, custom network configurations, persistent volumes, and container hardening for production.

Local Development Stack
Set up a base `docker-compose.yml` file with an app, database, and cache using health checks and bind mounts for hot reloading.
Container Hardening
Apply "no-new-privileges," "read-only," "cap_drop ALL," and a non-root user to reduce the attack surface.
Network Isolation
Define the frontend-net and backend-net networks so that the database is accessible only through the API.
Multi-stage Dockerfile
Separate dependencies, development, build, and production into stages to obtain minimal, optimized images.

Usage examples

🏗️ Complete stack
Generate a `docker-compose.yml` file for a Node.js app with PostgreSQL and Redis, including health checks and bind mounts for hot reload.
📦 Multi-stage Dockerfile
Create a multi-stage Dockerfile for Node.js with stages for dependencies, development, build, and minimal production.
🔒 Container security
Review my Dockerfile and add security best practices: non-root user, read-only, cap_drop, and no-new-privileges.
🌐 Isolated Networks
Set up custom networks in my Docker Compose file so that the database is only accessible via the API, not from the front end.

Features

Docker Compose Basics Template with an app, PostgreSQL, and Redis; health checks; persistent volumes; and development environment variables.
Multi-stage Dockerfile Separate stages for dependencies, development, build, and production to ensure optimized and secure images.
Network Isolation frontend-net and backend-net networks to restrict access between services and protect the database.
Container Hardening security_opt, read-only, tmpfs, cap_drop ALL, and a non-root user to minimize the attack surface.
Override for development Using `docker-compose.override.yml` for debug variables and additional ports without modifying the base Compose file.

Frequently asked questions

Yes. The skill generates the `docker-compose.yml` and `Dockerfile` files, but you need to have Docker and Docker Compose installed to run them.
The examples use Node.js, but the networking, volume, security, and multi-stage patterns are applicable to any stack.
It is a file that Docker Compose automatically loads on top of the base Compose file, ideal for development configurations such as additional ports or debug variables.
Yes. The skill generates templates as a starting point; ask Claude to customize them based on your stack, services, and specific requirements.
Docker Patterns — Containers and Docker Compose with Claude AI

¿Prefieres escuchar el contenido? Genera la narración de audio con un clic.