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
- This will relay
docker-compose -f <file> $params$
- This will add custom commands like
dopr bash ...,
dopr composer ...and
nodewill be launched with the user
- This will use a different config if NODE_ENV is set to production or if dopr is with
"file"value can be array or string.
dopr ip <container-name>to print the IP address of container.
- To change service container for above default actions simply extend the node with override
Sample configuration with all usecases:
"actions".[$key]."command"can be either array or string.
- The command can be reused or recalled by prefixing it with
@(see sample above).
- The command that should run in host context will need
"@host"(see sample above).
- The action can optionally provide default arguments in
"args"used to interpolate
%args%when no other argument is provided (see
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
stop, just like you would with
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
composer like so
$ dopr npm run my-script
$ 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
You can also specify a different service if required. So you can add shortcuts for other docker instances like mysql as well.
Copyright (c) 2017 Crazy Factory Trading Co. Ltd.
Licensed under the MIT license.
See LICENSE for more info.