
docker-local
Custom Docker Compose local development patterns. Use when working with Docker-based local environments, container configuration, or troubleshooting Docker setups.
- Installs
- 101
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/madsnorgaard/drupal-agent-resources --skill docker-local- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads docker-local automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Docker Compose Local Development
You are working with custom Docker Compose local development environments (non-DDEV).
Environment Detection
When working on a project with Docker, first detect the setup:
# Check for compose files
ls -la docker-compose*.yml compose*.yml 2>/dev/null
# Check for environment files
ls -la .env* 2>/dev/null
# Check for Makefile or scripts
ls -la Makefile docker/ scripts/ 2>/dev/null
Common Commands
Project Lifecycle
docker compose up -d # Start in background
docker compose up -d --build # Start with rebuild
docker compose down # Stop and remove containers
docker compose down -v # Also remove volumes (DATA LOSS!)
docker compose restart # Restart all services
Running Commands
# In running container
docker compose exec <service> <command>
# Examples
docker compose exec php composer install
docker compose exec php ./vendor/bin/drush cr
docker compose exec php bash
# In new container (if service not running)
docker compose run --rm php composer install
Debugging
docker compose ps # Show container status
docker compose logs -f # Follow all logs
docker compose logs -f php # Follow specific service
docker compose top # Show processes
docker compose exec php env # Show environment
Drupal Docker Patterns
Common Service Names
Projects vary, but common patterns:
| Service Type | Common Names |
|---|---|
| PHP/Web | php, web, app, drupal, php-fpm |
| Database | db, mysql, mariadb, postgres |
| Cache | redis, memcached |
| Search | solr, elasticsearch |
Running Drush
# Find the PHP container
docker compose ps
# Run Drush (path may vary)
docker compose exec php drush cr
docker compose exec php ./vendor/bin/drush cr
docker compose exec web vendor/bin/drush cr
Database Operations
# MySQL/MariaDB
docker compose exec db mysql -u root -p<password> <database>
# Import
docker compose exec -T db mysql -u root -p<password> <database> < dump.sql
# Export
docker compose exec db mysqldump -u root -p<password> <database> > dump.sql
# PostgreSQL
docker compose exec db psql -U <user> <database>
Standard Docker Compose Template
For Drupal projects without DDEV:
# docker-compose.yml
services:
php:
build:
context: .
dockerfile: docker/php/Dockerfile
volumes:
- .:/var/www/html:cached
depends_on:
- db
environment:
- PHP_MEMORY_LIMIT=512M
web:
image: nginx:alpine
ports:
- "8080:80"
volumes:
- .:/var/www/html:ro
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- php
db:
image: mariadb:10.11
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: drupal
MYSQL_USER: drupal
MYSQL_PASSWORD: drupal
volumes:
- db-data:/var/lib/mysql
ports:
- "3306:3306"
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
db-data:
PHP Dockerfile
# docker/php/Dockerfile
FROM php:8.2-fpm
RUN apt-get update && apt-get install -y \
git unzip libpng-dev libjpeg-dev libfreetype6-dev \
libzip-dev libicu-dev mariadb-client \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd pdo_mysql zip intl opcache bcmath
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html
Nginx Config
# docker/nginx/default.conf
server {
listen 80;
server_name localhost;
root /var/www/html/web;
index index.php;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php$ {
fastcgi_pass php:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Makefile Wrapper
Simplify commands with a Makefile:
# Makefile
.PHONY: up down restart shell drush composer logs
up:
docker compose up -d
down:
docker compose down
restart:
docker compose restart
shell:
docker compose exec php bash
drush:
docker compose exec php ./vendor/bin/drush $(filter-out $@,$(MAKECMDGOALS))
composer:
docker compose exec php composer $(filter-out $@,$(MAKECMDGOALS))
logs:
docker compose logs -f
db-import:
docker compose exec -T db mysql -u root -proot drupal < $(file)
db-export:
docker compose exec db mysqldump -u root -proot drupal > dump.sql
%:
@:
Usage:
make up
make drush cr
make composer require drupal/module
make db-import file=backup.sql
Troubleshooting
Port Conflicts
# Find what's using a port
sudo lsof -i :80
sudo lsof -i :3306
# Check all Docker ports
docker ps --format "table {{.Names}}\t{{.Ports}}"
Container Won't Start
docker compose logs <service> # Check logs
docker compose down && docker compose up -d --build # Rebuild
docker compose down -v && docker compose up -d # Fresh start (loses data!)
Permission Issues
# Check container user
docker compose exec php id
# Fix web directory permissions
docker compose exec php chown -R www-data:www-data /var/www/html/web/sites/default/files
Network Issues
# Containers reach each other by service name
# From PHP container: mysql -h db -u root -proot
# Inspect network
docker network ls
docker network inspect <project>_default
Performance (macOS/Windows)
Slow file sync on macOS/Windows:
- Use
:cachedvolume flag - Exclude
vendor/andnode_modules/from sync - Consider Docker Desktop's VirtioFS (macOS)
volumes:
- .:/var/www/html:cached
- vendor:/var/www/html/vendor # Named volume for vendor
Environment Variables
.env File
Docker Compose auto-loads .env:
COMPOSE_PROJECT_NAME=myproject
PHP_VERSION=8.2
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=drupal
Drupal settings.php
// settings.php for Docker
$databases['default']['default'] = [
'driver' => 'mysql',
'database' => getenv('MYSQL_DATABASE') ?: 'drupal',
'username' => getenv('MYSQL_USER') ?: 'drupal',
'password' => getenv('MYSQL_PASSWORD') ?: 'drupal',
'host' => getenv('DB_HOST') ?: 'db',
'port' => getenv('DB_PORT') ?: 3306,
];
// Redis (if using)
if (getenv('REDIS_HOST')) {
$settings['redis.connection']['host'] = getenv('REDIS_HOST') ?: 'redis';
$settings['cache']['default'] = 'cache.backend.redis';
}
Best Practices
- Version your docker-compose.yml - Ensure consistent environments
- Use .env for secrets - Never commit passwords
- Create a Makefile - Simplify commands for the team
- Document in README - How to start, stop, access services
- Use named volumes - For database persistence
- Health checks - Ensure services are ready before dependent services start
FAQ
What does the docker-local skill do?
Custom Docker Compose local development patterns. Use when working with Docker-based local environments, container configuration, or troubleshooting Docker setups.
How do I install docker-local?
Run npx skills add https://github.com/madsnorgaard/drupal-agent-resources --skill docker-local in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/docker-local/ (personal) or .claude/skills/docker-local/ (project).
Which AI agents can use docker-local?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is docker-local safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains docker-local?
It is published by madsnorgaard in madsnorgaard/drupal-agent-resources. It has 101 recorded installs.
More from madsnorgaard/drupal-agent-resources
drupal-expert
madsnorgaard/drupal-agent-resources
Drupal 10/11 development expertise. Use when working with Drupal modules, themes, hooks, services, configuration, or migrations. Triggers on mentions of Drupal, Drush, Twig, modules, themes, or Drupal API.
drupal-security
madsnorgaard/drupal-agent-resources
Drupal security expertise. Auto-activates when writing forms, controllers, queries, or handling user input. Prevents XSS, SQL injection, and access bypass vulnerabilities.
ddev-expert
madsnorgaard/drupal-agent-resources
DDEV local development expertise. Use when working with DDEV projects, containers, configuration, or troubleshooting DDEV environments.
drupal-migration
madsnorgaard/drupal-agent-resources
Drupal migration expertise. Use when working with D7-to-D10 migrations, CSV imports, JSON API imports, or custom migration plugins.
Popular devops & cloud skills
microsoft-foundry
microsoft/azure-skills
Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure
azure-diagnostics
microsoft/azure-skills
Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
azure-prepare
microsoft/azure-skills
Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
azure-deploy
microsoft/azure-skills
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.
azure-validate
microsoft/azure-skills
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.