No description
Find a file
gautaz b0ab29bbb3 update commands documentation
also:

* fix port options
* order the list alphabetically
2021-08-16 09:57:07 +02:00
.github/workflows ci: run on PRs 2021-05-09 01:14:40 +02:00
.husky build(deps): update dev dependencies 2021-04-10 17:00:37 +02:00
.vscode style: use prettier + typescript-eslint 2021-04-10 23:25:54 +02:00
community-samples add community samples structure 2019-04-06 16:53:47 +02:00
docs update commands documentation 2021-08-16 09:57:07 +02:00
src feat: single container pause and unpause added 2021-07-20 12:27:46 +02:00
test fix: now lints correctly 2021-07-20 12:27:46 +02:00
.editorconfig style: append new line via .editorconfig 2021-04-10 22:06:43 +02:00
.eslintrc.js style: run prettier 2021-04-10 23:25:54 +02:00
.gitignore chore: git ignore vuepress cache and temp folders 2021-04-11 00:30:42 +02:00
.npmignore build(release): shrink npm package size 2021-07-20 13:02:50 +02:00
.prettierrc.js style: use prettier + typescript-eslint 2021-04-10 23:25:54 +02:00
CHANGELOG.md chore(release): 0.23.13 2021-07-20 12:36:30 +02:00
jest.config.js Migrate to Typescript 2019-07-14 03:13:14 +02:00
LICENSE Update LICENSE 2021-01-15 00:43:14 +01:00
package.json security: update dependencies to fix security issues 2021-08-13 12:07:22 +02:00
readme.md docs: fix wording 2021-06-15 11:56:08 +02:00
tsconfig.json Fix linting issues after build, import proper es2015 lib 2019-07-30 10:57:15 +02:00
yarn.lock security: update dependencies to fix security issues 2021-08-13 12:07:22 +02:00

Conventional Commits Join the chat at https://gitter.im/pdmlab/docker-compose

Manage Docker-Compose via Node.js

docker-compose is a small library that allows you to run docker-compose(which is still required) via Node.js. This is useful to bootstrap test environments.

Installation

yarn add --dev docker-compose

Documentation

The documentation can be found here.

Example

To start service containers based on the docker-compose.yml file in your current directory, just call compose.up like this:

compose.upAll({ cwd: path.join(__dirname), log: true }).then(
  () => {
    console.log('done')
  },
  (err) => {
    console.log('something went wrong:', err.message)
  }
)

To execute command inside a running container

compose.exec('node', 'npm install', { cwd: path.join(__dirname) })

Running the tests

While docker-compose runs on Node.js 6+, running the tests requires you to use Node.js 8+ as they make use of async/await.

yarn test

Want to help?

This project is just getting off the ground and could use some help with cleaning things up and refactoring.

If you want to contribute - we'd love it! Just open an issue to work against so you get full credit for your fork. You can open the issue first so we can discuss and you can work your fork as we go along.

If you see a bug, please be so kind as to show how it's failing, and we'll do our best to get it fixed quickly.

Before sending a PR, please create an issue to introduce your idea and have a reference for your PR.

We're using conventional commits, so please use it for your commits as well.

Also please add tests and make sure to run yarn lint.

Discussions

If you want to discuss an docker-compose issue or PR in more detail, feel free to start a discussion.

License

MIT License

Copyright (c) 2017 - 2021 PDMLab

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.