D

docker-node-boilerplate

Boilerplate structure to build, test, and deploy Docker & Node.js applications

Name Last Update
script Loading commit data...
src Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.gitlab-ci.yml Loading commit data...
Dockerfile Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
docker-compose.yml Loading commit data...
package.json Loading commit data...

Docker & Node Boilerplate

This repo uses make and docker-compose to orchestrate the build and test process. See the SlashDeploy blog for more information.

Usage

  1. Download/clone this repo for your project
  2. Remove vendor/node_modules.tar.gz from .gitignore
  3. Set the Docker image name in docker-compose.yml
  4. (Optional) remove .gitlab-ci.yml if you're not using GitLab.
  5. Run make clean test-ci -- things should pass!
  6. Start coding!
  7. Run make test -- things should still pass!
  8. Run make clean test-ci to test the final Docker image

Structure

The docker-compose.yml manages containers for the development and test cycle. The app container uses the image that would eventually go to production. The tests container is for running quick tests. The source code directory is mounted as a local volume so there's no need to rebuild the image to run tests. The smoke container executes a smoke test against the app container.