mirror of
https://github.com/danbulant/docker-compose
synced 2026-06-24 17:31:53 +00:00
readme
This commit is contained in:
parent
4d7fac4b2a
commit
e601a19e4b
1 changed files with 19 additions and 6 deletions
25
readme.md
25
readme.md
|
|
@ -12,13 +12,21 @@ npm install --save-dev docker-compose
|
||||||
|
|
||||||
`docker-compose` current supports these commands:
|
`docker-compose` current supports these commands:
|
||||||
|
|
||||||
* up - create and start containers - always uses the `-d` flag due to non interactive mode
|
* `up(options)` - create and start containers - always uses the `-d` flag due to non interactive mode
|
||||||
* down - Stop and remove containers, networks, images, and volumes
|
* `down(options)` - Stop and remove containers, networks, images, and volumes
|
||||||
* kill - Kill containers
|
* `kill(options)` - Kill containers
|
||||||
* stop - Stop services
|
* `stop(options)` - Stop services
|
||||||
* rm - Remove stopped containers - always uses the `-f` flag due to non interactive mode
|
* `rm(options)` - Remove stopped containers - always uses the `-f` flag due to non interactive mode
|
||||||
|
* `exec(container, command, options)` - Exec `command` inside `container`, uses `-T` to properly handle stdin & stdout
|
||||||
|
* `run(container, command, options)` - Run `command` inside `container`, uses `-T` to properly handle stdin & stdout
|
||||||
|
|
||||||
All commands return a Promise.
|
All commands return a `Promise({object})` with an stdout and stderr strings
|
||||||
|
```javascript
|
||||||
|
{
|
||||||
|
out: 'stdout contents'
|
||||||
|
err: 'stderr contents'
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
|
@ -32,6 +40,11 @@ compose.up({ cwd: path.join(__dirname), log: true })
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To execute command inside a running container
|
||||||
|
```javascript
|
||||||
|
compose.exec('node', 'npm install', { cwd: path.join(__dirname) })
|
||||||
|
```
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
`docker-compose` accepts these params:
|
`docker-compose` accepts these params:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue