Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/apocas/dockerode-compose
docker-compose in Node.js using dockerode
https://github.com/apocas/dockerode-compose
compose docker docker-compose dockerode nodejs
Last synced: 1 day ago
JSON representation
docker-compose in Node.js using dockerode
- Host: GitHub
- URL: https://github.com/apocas/dockerode-compose
- Owner: apocas
- License: apache-2.0
- Created: 2021-04-05T19:40:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-05T19:14:25.000Z (7 months ago)
- Last Synced: 2024-12-14T18:05:14.047Z (8 days ago)
- Topics: compose, docker, docker-compose, dockerode, nodejs
- Language: JavaScript
- Homepage:
- Size: 185 KB
- Stars: 145
- Watchers: 10
- Forks: 31
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dockerode-compose
`docker-compose` in Node.js using [dockerode](https://github.com/apocas/dockerode).
Everything is executed programmatically using `dockerode`, consequently Docker's API.
### ToDo:
* Finish compose spec
* User friendly functions (partial deploys, etc) needs to be implemented.## Installation
`npm install dockerode-compose`
### Getting started
To use `dockerode-compose` first you need to instantiate it:
``` js
var Dockerode = require('dockerode');
var DockerodeCompose = require('dockerode-compose');var docker = new Dockerode();
var compose = new DockerodeCompose(docker, './test/wordpress.yml', 'wordpress');(async () => {
await compose.pull();
var state = await compose.up();
console.log(state);
})();
```## Documentation
- new DockerodeCompose(dockerode, file, project_name)
- compose.up()
- compose.pull(service, options) - omit service to pull all images, options.streams return the streams without waiting, options.verbose pipe the streams to stdout.## Tests
* Tests are implemented using `mocha` and `chai`. Run them with `npm test`.
## Examples
Check the examples folder for more specific use cases examples.
## License
Pedro Dias - [@pedromdias](https://twitter.com/pedromdias)
Licensed under the Apache license, version 2.0 (the "license"); You may not use this file except in compliance with the license. You may obtain a copy of the license at:
http://www.apache.org/licenses/LICENSE-2.0.html
Unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "as is" basis, without warranties or conditions of any kind, either express or implied. See the license for the specific language governing permissions and limitations under the license.