docker-compose-basics
Use when defining and running multi-container Docker applications with Docker Compose YAML configuration.
Works with
---
name: docker-compose-basics
description: Use when defining and running multi-container Docker applications with Docker Compose YAML configuration.
license: Apache-2.0
---
# Docker Compose Basics
Docker Compose for defining and running multi-container applications.
## Basic Structure
```yaml
version: '3.8'
services:
web:
image: nginx:latest
ports:
- "80:80"
volumes:
- ./html:/usr/share/nginx/html
environment:
- NGINX_HOST=localhost
depends_on:
- api
api:
build: ./api
ports:
- "3000:3000"
environment:
DATABASE_URL: postgres://db:5432/myapp
depends_on:
- db
db:
image: postgres:15
volumes:
- pgdata:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: secret
POSTGRES_DB: myapp
volumes:
pgdata:
```
## Common Commands
```bash
# Start services
docker compose up
# Start in background
docker compose up -d
# Stop services
docker compose down
# View logs
docker compose logs -f
# Rebuild
docker compose build
# Execute command
docker compose exec web sh
# Scale service
docker compose up -d --scale api=3
```
## Best Practices
### Environment Variables
```yaml
services:
api:
environment:
- NODE_ENV=${NODE_ENV:-development}
- API_KEY=${API_KEY}
```
### Health Checks
```yaml
services:
web:
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 30s
timeout: 10s
retries: 3
```
### Resource Limits
```yaml
services:
api:
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
```More DevOps & Infrastructure skills
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.
appinsights-instrumentation
microsoft/azure-skills
Guidance for instrumenting webapps with Azure Application Insights. Provides telemetry patterns, SDK setup, and configuration references. WHEN: how to instrument app, App Insights SDK, telemetry patterns, what is App Insights, Application Insights guidance, instrumentation examples, APM best practices.
azure-storage
microsoft/azure-skills
Azure Storage Services including Blob Storage, File Shares, Queue Storage, Table Storage, and Data Lake. Answers questions about storage access tiers (hot, cool, cold, archive), when to use each tier, and tier comparison. Provides object storage, SMB file shares, async messaging, NoSQL key-value, and big data analytics. Includes lifecycle management. USE FOR: blob storage, file shares, queue storage, table storage, data lake, upload files, download blobs, storage accounts, access tiers, storage tiers, hot cool cold archive, storage tier comparison, when to use storage tiers, lifecycle management, Azure Storage concepts. DO NOT USE FOR: SQL databases, Cosmos DB (use azure-prepare), messaging with Event Hubs or Service Bus (use azure-messaging).

