Docker Compose Setup
Description
Creates Docker and docker-compose configurations for development and production environments. Includes proper networking, volumes, health checks, and environment variables.
Code
Skill Code
Configuration includes:
1. Dockerfile with multi-stage builds
2. docker-compose.yml "keyword">for dev
3. docker-compose.prod.yml
4. .dockerignore
5. Health checks
6. Volume mounts
7. Network configuration
Usage Examples
Examples
User: dockerize my Node.js app
Claude: *creates files*
```yaml
# docker-compose.yml
services:
app:
build: .
ports:
- "3000:3000"
volumes:
- .:/app
- /app/node_modules
environment:
- NODE_ENV=development
depends_on:
db:
condition: service_healthy
db:
image: postgres:15
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
```
Installation
Add the following to your CLAUDE.md file (project root or ~/.claude/CLAUDE.md for global):
CLAUDE.md
# Docker Setup Assistant When dockerizing a project: 1. Analyze the project type and dependencies 2. Create optimized multi-stage Dockerfile 3. Generate docker-compose.yml with: - Service definitions - Volume mounts for development - Environment variables - Health checks - Proper networking 4. Create .dockerignore file 5. Add docker-compose.prod.yml for production
Run this command to install:
Terminal
docker compose up -d
Comments (0)
No comments yet. Be the first to share your thoughts!
Leave a Comment