api-and-interface-desi…
Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints,…
Multi-container Docker applications with docker-compose — define services, networks, volumes, and orchestrate local development environments
$ npx -y skills add kevinnft/ai-agent-skills --skill docker-compose --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/docker-composeContext preview
The summary Claude sees to decide when to auto-load this skill.
Multi-container Docker applications with docker-compose — define services, networks, volumes, and orchestrate local development environments
name: docker-compose description: Multi-container Docker applications with docker-compose — define services, networks, volumes, and orchestrate local development environments tags: [docker, containers, devops, orchestration, development] origin: unknown source_license: see upstream language: en
Manage multi-container Docker applications with docker-compose. Define services, networks, volumes, and dependencies in YAML. Perfect for local development, testing, and simple production deployments.
services:
app:
build: .
ports:
- "3000:3000"
depends_on:
- db
db:
image: postgres:15
environment:
POSTGRES_PASSWORD: secret
volumes:
- db-data:/var/lib/postgresql/data
volumes:
db-data:networks:
frontend:
backend:
services:
app:
networks:
- frontend
- backend
db:
networks:
- backendversion: '3.8'
services:
frontend:
build: ./frontend
ports:
- "3000:3000"
environment:
- REACT_APP_API_URL=http://localhost:8000
depends_on:
- backend
backend:
build: ./backend
ports:
- "8000:8000"
environment:
- DATABASE_URL=postgresql://user:pass@db:5432/myapp
depends_on:
- db
db:
image: postgres:15
environment:
- POSTGRES_USER=user
- POSTGRES_PASSWORD=pass
- POSTGRES_DB=myapp
volumes:
- postgres-data:/var/lib/postgresql/data
volumes:
postgres-data:services:
api:
build: ./api
ports:
- "8000:8000"
environment:
- REDIS_URL=redis://cache:6379
depends_on:
- cache
- db
worker:
build: ./worker
environment:
- REDIS_URL=redis://cache:6379
depends_on:
- cache
cache:
image: redis:7-alpine
ports:
- "6379:6379"
db:
image: postgres:15
environment:
- POSTGRES_PASSWORD=secret
volumes:
- db-data:/var/lib/postgresql/data
volumes:
db-data:services:
app:
build:
context: .
target: development
volumes:
- .:/app
- /app/node_modules
ports:
- "3000:3000"
environment:
- NODE_ENV=development
command: npm run dev# Start all services docker-compose up # Start in background docker-compose up -d # Build and start docker-compose up --build # Stop all services docker-compose down # Stop and remove volumes docker-compose down -v # View logs docker-compose logs -f # View logs for specific service docker-compose logs -f app # Execute command in service docker-compose exec app sh # Scale service docker-compose up -d --scale worker=3 # Restart service docker-compose restart app # View running services docker-compose ps
# .env POSTGRES_PASSWORD=secret API_PORT=8000
# docker-compose.yml
services:
db:
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
api:
ports:
- "${API_PORT}:8000"services:
app:
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40sservices:
app:
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.25'
memory: 256Mvolumes:
postgres-data:
driver: local
redis-data:
driver: local# Development docker-compose -f docker-compose.yml -f docker-compose.dev.yml up # Production docker-compose -f docker-compose.yml -f docker-compose.prod.yml up
# Find process using port lsof -i :3000 # Change port in docker-compose.yml ports: - "3001:3000"
# Check logs docker-compose logs app # Check service status docker-compose ps # Rebuild without cache docker-compose build --no-cache app
# Ensure depends_on is set depends_on: - db # Use service name as hostname DATABASE_URL=postgresql://user:pass@db:5432/myapp # Wait for database to be ready (use wait-for-it.sh or healthcheck)
# Set user in Dockerfile USER node # Or in docker-compose.yml user: "1000:1000"
# ❌ Don't use latest image: postgres:latest # ✅ Use specific version image: postgres:15.3-alpine
# Use Docker secrets (Swarm mode)
secrets:
db_password:
file: ./secrets/db_password.txt
services:
db:
secrets:
- db_passwordservices:
app:
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"services:
app:
restart: unless-stopped# .github/workflows/test.yml
- name: Run tests
run: |
docker-compose -f docker-compose.test.yml up --abort-on-container-exit
docker-compose -f docker-compose.test.yml down -vservices:
frontend:
build: ./frontend
ports:
- "3000:3000"
backend:
build: ./backend
ports:
- "5000:5000"
mongo:
image: mongo:6191 attribution-first agent skills for Hermes Agent, Claude Code, Cursor — one installer, 28 categories, searchable catalog. See NOTICE for upstream attribution.
Repo: kevinnft/ai-agent-skills
Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints,…
Tests in real browsers. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze…
Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test…
Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to…
Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend…
Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching between tasks, or when you need to configure…