Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@crazyfactory/docker-project-cli
Advanced tools
a cli tool to reduce your docker-compose overhead
A simple CLI tool simplify docker based project administration. Not meant to replace anything, just reducing your CLI overhead.
Install it globally for quick access
$ npm i -g @crazyfactory/docker-project-cli
Optionally install it locally, to pin down versions if required.
$ npm i --save @crazyfactory/docker-project-cli
Configuration of DOPR can be done either via package.json
under the dopr
key or with a provided file defaulting to docker-project.json
.
Default configuration:
{
"file": ["./docker/docker-compose.yml"],
"service": null,
"exec": true,
"actions": {
"down": {
"comment": "Stop and destroy the docker containers",
"command": ["%action% %args%"],
"exec": false
},
"up": {
"comment": "Bring the docker containers up and live",
"command": ["%action% %args%"],
"exec": false
},
"pull": {
"comment": "Pull the latest versions of docker containers",
"command": ["%action% %args%"],
"exec": false
},
"start": {
"comment": "Start the docker containers",
"command": ["%action% %args%"],
"exec": false
},
"stop": {
"comment": "Stop the docker containers",
"command": ["%action% %args%"],
"exec": false
},
"ip": {
"comment": "Print container IP address",
"service": "@host",
"command": ["docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' %args%"]
},
"bash": {
"comment": "Open the interactive terminal from default service container",
"command": ["%action% %args%"]
},
"composer": {
"comment": "Run the composer command in default service container",
"command": ["%action% %args%"]
},
"node": {
"comment": "Run the node command in default service container",
"command": ["%action% %args%"],
"user": "node"
},
"npm": {
"comment": "Run the npm command in default service container",
"command": ["%action% %args%"],
"user": "node"
},
"git": {
"comment": "Run the git command in default service container",
"command": ["%action% %args%"]
},
"yarn": {
"comment": "Run the yarn command in default service container",
"command": ["%action% %args%"]
},
"php": {
"comment": "Run the php command in default service container",
"command": ["%action% %args%"]
}
}
}
Notes:
up
, down
, start
and stop
to docker compose -f <file> $params$
dopr bash ...
, dopr composer ...
and dopr optimize
node
will be launched with the user node
by default.--env production
."file"
value can be array or string.dopr ip <container-name>
to print the IP address of container."service"
only.Sample configuration with all usecases:
{
"actions": {
"multiple-cmd": {
"command": ["echo multiple command as array", "@nested-cmd arg1 arg2"]
},
"nested-cmd": {
"command": ["echo nested command %args%", "@deepnested-cmd --opt1 val1 --opt2 val2"]
},
"deepnested-cmd": {
"command": ["echo deep nested command %args%"]
},
"host-cmd": {
"service": "@host",
"command": "docker compose version"
},
"composer": {
"args": "install --prefer-dist --no-scripts",
"command": "%action% %args%"
}
}
}
Notes:
"actions".[$key]."command"
can be either array or string.@
(see sample above)."service"
value of "@host"
(see sample above)."args"
used to interpolate %args%
when no other argument is provided (see "composer"."args"
above).dopr
will choose the correct docker-compose file for you and relay some of the most basic commands directly to docker compose.
To start you project in deamon mode run
$ dopr up -d
You can similarly use down
and stop
, just like you would with docker compose
directly.
You can add simple custom commands, but we add some by default. They are passed through to the service specified in your dopr configuration.
For instance to open a bash session just run
$ dopr bash
You can similarly access node
, npm
, git
and composer
like so
$ dopr npm run my-script
or so
$ dopr composer dump-autoload -o
Using the configuration you can add your own commands. If you want to use yarn
for instance, simply add it
{
"action": [
"yarn"
]
}
You can also specify a different service if required. So you can add shortcuts for other docker instances like mysql as well.
{
"action": [
{
"key": "mysql",
"service": "mysql-service"
}
]
}
Copyright (c) 2017 Crazy Factory Trading Co. Ltd.
Licensed under the MIT license.
See LICENSE for more info.
FAQs
a cli tool to reduce your docker-compose overhead
We found that @crazyfactory/docker-project-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.