docker-patterns

Configure Docker Compose files for local development with PostgreSQL and Redis.

Updated May 24, 2023
One-click install
npx skills add https://github.com/Kimjiman/basic-arch --skill docker-patterns-kimjiman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker-patterns
Source: https://github.com/Kimjiman/basic-arch/tree/main/.claude/skills/docker-patterns
Command: npx skills add https://github.com/Kimjiman/basic-arch --skill docker-patterns-kimjiman

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides best practices and patterns for using Docker and Docker Compose to build, manage, and deploy containerized applications efficiently and securely.

Core Features & Use Cases

  • Local Development Setup: Configure docker-compose.yml for rapid local development with features like hot-reloading and debugging.
  • Dockerfile Optimization: Learn to create lean, secure, and multi-stage Dockerfiles for both development and production.
  • Networking & Volumes: Understand service discovery, custom networks, and effective volume strategies for data persistence and management.
  • Security Hardening: Implement non-root users, capability dropping, and secure secret management.
  • Use Case: You need to set up a local development environment for a new web application that requires a PostgreSQL database and a Redis cache. This Skill will guide you in creating a docker-compose.yml file to orchestrate these services.

Quick Start

Use the docker-patterns skill to generate a standard docker-compose.yml for a web application with a PostgreSQL database and Redis.

Frequently Asked Questions about docker-patterns

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

FAQPage Schema
How do I configure docker-compose.yml for local development with a database and cache?

To configure docker-compose.yml for local development, you define your web application, PostgreSQL database, and Redis cache as separate services. This setup enables rapid local development by orchestrating multiple containers together with features like hot-reloading.

What's the best way to create a secure and lean Dockerfile for production?

The best way to create a secure Dockerfile is using multi-stage builds to minimize image size and implementing security hardening. This involves using non-root users, dropping unnecessary capabilities, and ensuring reproducible builds for production environments.

How does Docker networking and volume management work for container orchestration?

Docker networking enables service discovery across containers on custom networks, while volume management handles data persistence. Effective volume strategies ensure data is maintained and managed correctly even when containers are stopped or recreated.

When do I need Docker Compose override files for multi-service orchestration?

You need Docker Compose override files when managing multi-service orchestration across different environments. Override files allow you to customize base configurations for efficient development workflows or production deployments without altering the primary setup.

Can I use Docker for hot-reloading and debugging during local development?

Yes, Docker supports hot-reloading and debugging during local development through optimized compose configurations. By mounting local source code as volumes and configuring development services, you achieve an efficient workflow with live application updates.

Why does my containerized app need secure secret management and capability dropping?

Your containerized app needs secure secret management and capability dropping to enforce container security and prevent unauthorized access. Implementing these hardening patterns protects sensitive data and limits the potential attack surface of your deployed services.