Run docker-compose from Grunt
Integrate Docker Compose into your Grunt workflow. This plugin assumes that you
are already using Docker Compose and have your Compose file (docker-compose.yml
by default) ready. For more information about Docker Compose go here.
What this task does:
- passes environment variables to Compose file for Bash-like
$VARIABLE
usage - runs
docker-compose
commands inside a target directory
npm install grunt-compose --save-dev
In your project's Gruntfile, add a section named compose
to the data object
passed into grunt.initConfig()
.
grunt.initConfig({
compose: {
options: {
cmds: ['kill', 'up'],
cwd: 'docker',
env: {}
}
}
});
Type: Array
Default value: []
Array of docker-compose
commands to run sequentially.
Type: String
Default value: 'docker'
A relative directory that contains Compose file docker-compose.yml
.
Type: Object
Default value: {}
A set of environment variables that will be passed to yml file.
Example:
grunt.initConfig({
compose: {
options: {
cmds: ['up'],
env: {
FOO: 'bar'
}
}
}
});
grunt compose