10x docker
Docker and docker-compose best practices. Use for any Docker task: Dockerfiles (multi-stage builds, alpine, non-root), docker compose services (Go API, frontend, MariaDB, Oracle), healthchecks, volumes, networks, and K8S-compatible configurations.From its SKILL.md
npx -y skills add arhuman/claude-plugins --skill 10x-dockerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.9 KB, 894 tokens by cl100k_base, as published. Nobody here has run it
10x Docker
Dockerfile
For Go API please follow the recommendations in ./references/go-api-dockerfile.md For Frontend applications follow the recommendations in ./references/frontend-dockerfile.md
Dockerfile Performance
-
Layer Caching:
- Copy dependency files first (go.mod, package.json)
- Run dependency download before copying source
- Order COPY commands from least to most frequently changed
-
Build Optimization:
- Use multi-stage builds
- Minimize number of layers
- Combine RUN commands where appropriate
-
Development Speed:
- Provide Dockerfile_localbuild for fast iteration
- Use volume mounts for live reload
- Implement proper healthchecks
Docker-compose.yml
- Omit version field (recommended) or use
version: '3.9' - Use
services:as top-level key
Standard Service Patterns
For MariaDB service read ./references/mariadb-docker-compose-service.md For Oracle service read ./references/oracle-docker-compose-service.md For Go API service read ./references/go-api-docker-compose-service.md For Frontend service read ./references/frontend-docker-compose-service.md
Verification and Troubleshooting
Before completing any task, run through ./references/verification-checklist.md.
For build/runtime/permission issues, consult ./references/troubleshooting.md.
Volumes
Common Volume Patterns:
- Init Scripts:
./conf/docker/initdb:/docker-entrypoint-initdb.d - Configuration:
./conf/docker/mariadb.cnf:/etc/mysql/mariadb.cnf - Environment:
./env.sample:/home/dinfo/conf/.env - Logs:
/tmp/logs:/tmp/logs - Runtime Config:
./conf/docker/environment.json:/usr/share/nginx/html/assets/environments/environment.json
Ports
Standard Port Mappings:
- Application APIs:
8080:8080 - MariaDB:
23306:3306(non-conflicting external port) - Oracle:
1521:1521,5500:5500 - PostgreSQL:
25432:5432
Networks
- Use default network for simple setups
- Explicit networks only when needed for isolation
Environment Variables
Naming Convention:
- UPPERCASE with underscores
- Prefixed with component name (e.g.,
MARIADB_,ORACLE_) - Use
.envfiles for sensitive data (not committed) - Use
env.sampleas template
Common Variables:
MARIADB_ROOT_PASSWORD,MARIADB_DATABASE,MARIADB_USER,MARIADB_PASSWORDTZ=Europe/ZurichDOCKERFILEfor build variant selection
Best Practices
Security
-
Non-root User:
- Always run as non-root (USER 1001)
- Create dedicated user/group
- Set proper permissions for K8S compatibility
-
Minimal Images:
- Use alpine or slim variants when possible
- Multi-stage builds to reduce final image size
-
Secrets Management:
- Never commit passwords in docker-compose.yml
- Use environment variables
- Provide env.sample templates
- Use Docker secrets for production
Maintainability
-
Naming:
- Container names:
project-component(e.g.,persons-api,persons-db) - Image names: match container names
- Image tag: use explicit version number instead of 'latest'
- Service names: descriptive and consistent
- Container names:
-
Documentation:
- Comment architecture-specific choices
- Document environment variables
- Provide usage examples in README
-
Variants:
Dockerfile- Production with multi-stage buildDockerfile_localbuild- Local development (pre-built binary)Dockerfile_test- Testing environmentdocker-compose.yml- Main compositiondocker-compose.override.yml- Local overridesdocker-compose-test.yml- Test environmentdocker-compose-prod.yml- Production settings
What ships with it: 8 files
6.8 KB alongside SKILL.md