docker-patterns

Standardize Docker and docker-compose configurations for Laravel applications.

Updated Jan 6, 2023
One-click install
npx skills add https://github.com/pekral/phpstan-rules --skill docker-patterns-pekral
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker-patterns
Source: https://github.com/pekral/phpstan-rules/tree/main/.claude/skills/docker-patterns
Command: npx skills add https://github.com/pekral/phpstan-rules --skill docker-patterns-pekral

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the complexity of containerizing Laravel applications by providing standardized, secure, and performant configurations that prevent common pitfalls like bloated images, security vulnerabilities, and non-reproducible builds.

Core Features & Use Cases

  • Multi-Stage Builds: Optimizes image size by separating build-time dependencies from the lean production runtime.
  • Security Hardening: Enforces non-root execution, secret management via environment variables, and least-privileged database access.
  • Service Orchestration: Provides robust docker-compose templates for local development and production-ready service definitions including healthchecks and volume management.

Quick Start

Use the docker-patterns skill to generate a multi-stage Dockerfile and docker-compose configuration for a new Laravel project.

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 production-ready Docker environment for a Laravel application?

Standardized Docker configurations for Laravel use multi-stage builds to separate build-time dependencies from lean production runtimes. This approach prevents bloated images, security vulnerabilities, and non-reproducible builds in containerized environments.

What is the best way to optimize Docker image size for Laravel containers?

Security hardening for Laravel containers requires enforcing non-root execution, externalized secret management via environment variables, and least-privileged database access. These practices prevent common vulnerabilities in containerized applications.

Can I use docker-compose to orchestrate PHP-FPM, Nginx, MySQL, and Redis for Laravel?

Using Docker with Laravel requires configuring service orchestration for PHP-FPM, Nginx, MySQL, and Redis. You need docker-compose templates that define healthchecks, volume management, and multi-stage builds to ensure reproducible environments.

Does Docker containerization for Laravel support externalized secret management?

When containerizing Laravel, avoid running containers as root and storing secrets inside images. Multi-stage builds and externalized secret management via environment variables prevent bloated images and security vulnerabilities.