docker-patterns

Generate secure Docker Compose stacks with health checks and persistent volumes.

Updated Sep 13, 2025
One-click install
npx skills add https://github.com/llmh333/employee_management_spring --skill docker-patterns-llmh333
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker-patterns
Source: https://github.com/llmh333/employee_management_spring/tree/main/.gemini/skills/docker-patterns
Command: npx skills add https://github.com/llmh333/employee_management_spring --skill docker-patterns-llmh333

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the frustration of brittle local Docker setups that are insecure, hard to debug, and unreliable when multiple services must coordinate.

Core Features & Use Cases

  • Docker Compose local development stack: Provides a repeatable multi-service layout for an app with Postgres and Redis, including health checks and dependency ordering.
  • Multi-stage Dockerfile guidance: Demonstrates dev vs build vs production image patterns to reduce image size and improve runtime safety.
  • Networking, volumes, and security best practices: Covers service discovery by DNS, custom networks, safe exposure to the host, persistent volume strategies, non-root execution, and Compose hardening with safer filesystem and capability settings.
  • Practical debugging and anti-patterns: Offers common Docker commands for logs, exec, networking inspection, and identifies production-misuse pitfalls.

Quick Start

Ask the AI to generate a secure docker-compose setup for local development with an app container, Postgres health checks, Redis connectivity, persistent volumes, and non-root Dockerfile best practices.

Frequently Asked Questions about docker-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a secure Docker Compose local development stack with Postgres and Redis?

To set up a secure Docker Compose local development stack, configure Postgres health checks, Redis connectivity, and dependency ordering to coordinate multi-service startup. Persistent volumes and non-root Dockerfile practices further harden the setup.

What is a multi-stage Dockerfile and when do I need it for containerizing web services?

A multi-stage Dockerfile separates dev, build, and production image patterns to reduce image size and improve runtime safety. You need it when containerizing web services to isolate build dependencies from the final production image.

How do I troubleshoot Docker container networking and service discovery by DNS?

Troubleshoot Docker container networking by inspecting custom networks and verifying service-name DNS resolution. Use common Docker commands for logs, exec, and networking inspection to debug service discovery issues across multi-service setups.

What are the best practices for Docker container security with non-root users and capability dropping?

Docker container security best practices involve applying least-privilege settings: run as non-root users, drop capabilities, use read-only roots, and handle secrets safely. These hardening measures protect multi-service deployments.

Why does my Docker Compose service fail to start before its database dependency is ready?

Docker Compose services fail when dependency ordering lacks health checks, causing the app to start before Postgres or Redis is ready. Adding health checks and dependency controls ensures the app waits for database connectivity.

What persistent volume strategy should I use for Postgres data in local development?

A persistent volume strategy for Postgres data in local development uses named volumes to retain database state across container restarts. This ensures reliable data persistence without losing state during multi-service troubleshooting.