atomantic / generator-dockerize

Yeoman Generator: Scaffolding for Dockerized Development Environment
ISC License
10 stars 2 forks source link

Known Vulnerabilities

Yeoman Docker Generator

This Yeoman Generator will add a Docker scaffolding to your project, including Dockerfile, docker-compose and a dev script to simplify management of Docker and app runtime. The dev script automates getting your application up and running, starting, stopping, and other misc. missing docker commands.

Assumptions

Usage

if you are totally new to nodejs, you can install via ./dev init. This will install nvm (node version manager via Homebrew, then install node 4.4.6 and run npm install -g yo git://github.com/atomantic/generator-dockerize.git for you).

You can run the dev init script from curl like so:

curl https://raw.githubusercontent.com/atomantic/generator-dockerize/master/dev | sh -s init

If you are already using node and have npm, just run this:

npm install -g yo git://github.com/atomantic/generator-dockerize.git
# cd to your project directory
yo dockerize

Getting Started

  1. run yo dockerize on your project
  2. edit ./app/exec to have proper app execute instructions
  3. edit docker-compose.tmpl if needed
  4. edit the Dockerfile as needed to construct your app
  5. edit dev.init.sh if needed to run any host setup before docker image is created
  6. run dev init

The dev script will ensure that you have all the docker software and configuration needed to run and will run your app inside a docker container.

Testing Your Docker Image / App

You can run dev test to test either the running instance or to run and test a new instance. Before running dev test, you should update test.sh (at the bottom) to add a test runner execution command.

Scaffolding Contents

Dev Toolkit

run dev help to get a list of options on the dev script

Updates

To get updates to the dockerized dev toolkit after you run the generator, simply run dev update. This will fetch the latest dev toolkit from github and replace it in your project. Then you can use any new automated fixes for docker that are in the latest release.

Contributing

Please contribute! We welcome all pull-requests. The current setup makes certain assumptions that we probably don't always want. TODO:

We could make this whole thing work from yo instead of requiring users to manually adjust their files after scaffolding :)

HISTORY

3.0.0

2.2.0

2.0.0

1.8.0

1.7.0

1.6.1

1.6.0

1.5.0

1.4.0

1.3.0

1.2.4

1.2.2

1.2.1

1.2.0

Support

Hey dude! Help me out for a couple of :beers:!

Beerpay