From docker-specialist
Generates secure Docker Compose configurations for PostgreSQL, MySQL, MongoDB, and Redis with persistence, health checks, network isolation, and init scripts. Ideal for local development databases.
npx claudepluginhub mwguerra/claude-code-plugins --plugin docker-specialistThis skill uses the workspace's default tool permissions.
This skill configures database containers following best practices for:
Provides Dockerfiles, docker-compose setups, and best practices for NestJS/Next.js apps including multi-stage builds, health checks, MongoDB/Redis integration, and production configs.
Generates Docker Compose configurations for multi-container apps with services, networks, volumes, health checks, dependencies, and environment setup. Useful for dev/prod orchestration.
Generates optimized multi-stage Dockerfiles and docker-compose configs for containerizing Node.js, Python, Go, Rust apps with health checks, volumes, and non-root security.
Share bugs, ideas, or general feedback.
This skill configures database containers following best practices for:
Read 05-databases.md for:
services:
postgres:
image: postgres:16-alpine
container_name: postgres
restart: unless-stopped
shm_size: 256mb
environment:
POSTGRES_USER: ${DB_USER:-appuser}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME:-appdb}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init-scripts:/docker-entrypoint-initdb.d
ports:
- "127.0.0.1:5432:5432"
networks:
- database
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-appuser} -d ${DB_NAME:-appdb}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
volumes:
postgres_data:
networks:
database:
internal: true
services:
mysql:
image: mysql:8.0
container_name: mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql
- ./init-scripts:/docker-entrypoint-initdb.d
ports:
- "127.0.0.1:3306:3306"
command: >
--default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 5
volumes:
mysql_data:
services:
mongodb:
image: mongo:7
container_name: mongodb
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGO_DB}
volumes:
- mongo_data:/data/db
- mongo_config:/data/configdb
ports:
- "127.0.0.1:27017:27017"
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
volumes:
mongo_data:
mongo_config:
services:
redis:
image: redis:7-alpine
container_name: redis
restart: unless-stopped
command: >
redis-server
--appendonly yes
--maxmemory 256mb
--maxmemory-policy allkeys-lru
--requirepass ${REDIS_PASSWORD}
volumes:
- redis_data:/data
ports:
- "127.0.0.1:6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
redis_data:
DATABASE_URL=postgresql://user:password@db:5432/dbname
DATABASE_URL=mysql://user:password@db:3306/dbname
MONGO_URI=mongodb://user:password@mongodb:27017/dbname?authSource=admin
REDIS_URL=redis://:password@redis:6379
# PostgreSQL
docker compose exec -T db pg_dumpall -c -U appuser > backup.sql
# MySQL
docker compose exec -T db mysqldump -u root -p"$PASS" --all-databases > backup.sql
# MongoDB
docker compose exec -T db mongodump --archive --gzip > backup.gz
# Redis (if persistence enabled)
docker compose exec redis redis-cli -a "$PASS" BGSAVE
# PostgreSQL
docker compose exec -T db psql -U appuser -d appdb < backup.sql
# MySQL
docker compose exec -T db mysql -u root -p"$PASS" < backup.sql
# MongoDB
docker compose exec -T db mongorestore --archive --gzip < backup.gz