docker-patterns

Provide Docker and Docker Compose patterns for local development, security, networking, and volumes.

1|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/riftzen-bit/gemini-setup --skill docker-patterns-riftzen-bit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker-patterns
Source: https://github.com/riftzen-bit/gemini-setup/tree/main/skills/docker-patterns
Command: npx skills add https://github.com/riftzen-bit/gemini-setup --skill docker-patterns-riftzen-bit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Docker and Docker Compose configurations are often inconsistent, insecure, or poorly optimized for development and production parity; this Skill provides clear patterns to standardize local stacks, container security, networking, and volume strategies to reduce runtime failures and operational surprises.

Core Features & Use Cases

  • Composable Development Stacks: Opinionated docker-compose layouts for multi-service applications with development overrides and production overlays.
  • Multi-stage Dockerfiles: Patterns for dev, build, and production stages to minimize image size and enable hot-reload during development.
  • Networking & Volume Strategies: Service discovery by name, custom network segmentation, named volumes for persistence, and bind mounts for hot reload.
  • Security & Hardening: Non-root users, pinned image tags, read-only filesystems, capability drops, healthchecks, and secret management recommendations.
  • Debugging & Maintenance: Common commands for logs, exec, inspect, rebuilds, and destructive cleanup with safety notes.
  • Use Case Example: Scaffold a Node.js web app with Postgres and Redis for local development, include init scripts, healthchecks, and a mail testing service.

Quick Start

Generate a docker-compose.yml and a multi-stage Dockerfile for a Node.js web app with Postgres and Redis that includes named volumes, healthchecks, non-root user configuration, and a development override for hot-reload.

Frequently Asked Questions about docker-patterns

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

FAQPage Schema
How do I create a multi-stage Dockerfile that minimizes image size and supports hot-reload?

Multi-stage Dockerfiles separate dev, build, and production stages to minimize image size while enabling hot-reload during development. You define distinct stages for building dependencies and running the final optimized production image.

What's the best way to configure Docker Compose for local multi-service development?

Docker Compose multi-service development uses opinionated layouts with service discovery by name, custom network segmentation, named volumes for persistence, and bind mounts for hot reload. Development overrides and production overlays standardize the stack.

How do I secure Docker containers using non-root users and read-only filesystems?

Container security hardening uses non-root users, pinned image tags, read-only filesystems, capability drops, and healthchecks. Secret management recommendations ensure sensitive data is protected across your Docker Compose configurations.

Why does my container lose data when restarting and how do named volumes fix this?

Named volumes provide persistent storage independent of container lifecycle, fixing data loss on restarts. Docker Compose volume strategies map named volumes for database persistence and bind mounts for live code synchronization during development.

How do I add healthchecks to a Node.js and Postgres Docker Compose stack?

Healthchecks in Docker Compose monitor service readiness for Node.js and Postgres stacks. You configure test commands, intervals, timeouts, and retries to ensure dependent services wait for database availability before starting.

How do I troubleshoot Docker container networking and volume issues?

Troubleshooting Docker networking and volumes uses common commands for logs, exec, inspect, rebuilds, and destructive cleanup. Safety notes guide you through resolving runtime failures and operational surprises in container configurations.