2017-05-18 21:21:33 +03:00
|
|
|
# docker-compose-client
|
|
|
|
|
2017-06-01 00:35:35 +03:00
|
|
|
[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
|
|
|
|
[![npm](https://img.shields.io/npm/v/docker-compose-client.svg)](https://npmjs.com/package/docker-compose-client)
|
|
|
|
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg)](https://github.com/RichardLitt/standard-readme)
|
2017-05-18 21:21:33 +03:00
|
|
|
|
|
|
|
Server that exposes [CloudApi](https://apidocs.joyent.com/cloudapi/) through [GraphQL](http://graphql.org).
|
|
|
|
|
|
|
|
## Table of Contents
|
|
|
|
|
|
|
|
- [Install](#install)
|
2017-06-02 00:50:29 +03:00
|
|
|
- [Server](#server)
|
2017-05-18 21:21:33 +03:00
|
|
|
- [Usage](#usage)
|
|
|
|
- [License](#license)
|
|
|
|
|
|
|
|
## Install
|
|
|
|
|
|
|
|
```
|
|
|
|
yarn add docker-compose-client
|
|
|
|
```
|
|
|
|
|
2017-06-02 00:50:29 +03:00
|
|
|
## Server
|
|
|
|
|
|
|
|
### build
|
|
|
|
|
|
|
|
```
|
|
|
|
λ git clone git@github.com:yldio/docker-compose-api.git
|
|
|
|
λ cd docker-compose-api
|
2017-06-02 00:53:57 +03:00
|
|
|
λ docker build -t docker-compose-api .
|
2017-06-02 00:50:29 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
### run
|
|
|
|
|
|
|
|
**local**:
|
|
|
|
|
|
|
|
```
|
|
|
|
λ docker run -p 4242:4242 -d docker-compose-api
|
|
|
|
```
|
|
|
|
|
|
|
|
**remote**:
|
|
|
|
```
|
|
|
|
λ docker run \
|
|
|
|
-v "/local/path/to/docker/cert":"/usr/src/cert" \
|
|
|
|
-e DOCKER_CERT_PATH=/usr/src/cert \
|
|
|
|
-e DOCKER_HOST="http://us-sw-1.docker.joyent.com:2376" \
|
|
|
|
-e DOCKER_CLIENT_TIMEOUT=300 \
|
|
|
|
-e COMPOSE_HTTP_TIMEOUT=300 \
|
|
|
|
-p 4242:4242 \
|
|
|
|
-d \
|
|
|
|
docker-compose-api
|
|
|
|
```
|
|
|
|
|
2017-05-18 21:21:33 +03:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
```js
|
|
|
|
const client = new DockerComposeClient();
|
|
|
|
|
2017-06-03 01:16:49 +03:00
|
|
|
client.provision({
|
2017-05-18 21:21:33 +03:00
|
|
|
projectName: 'docker-compose-client',
|
|
|
|
manifest: `
|
|
|
|
hello:
|
|
|
|
image: hello-world:latest
|
|
|
|
world:
|
|
|
|
image: consul:latest
|
|
|
|
node:
|
|
|
|
image: node:latest
|
|
|
|
`
|
2017-06-03 01:16:49 +03:00
|
|
|
}, (err, res, more) => {
|
|
|
|
// can be called multiple times, check 'more' if that is the case
|
2017-05-18 21:21:33 +03:00
|
|
|
});
|
|
|
|
```
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
MPL-2.0
|