/docker-setup-for-node-postgres-sequelize-for-production-and-development-and-travisCI

Use docker to containerize a nodejs app for production and development as well continuous integration with Travis CI

Primary LanguageJavaScript

The following are simple docker compose commands to get started

But for this particular app to build it just use the following

  • docker-compose -f docker-compose.dev.yml up --build
  • docker-compose -f docker-compose.prod.yml up --build

Start all services

This will start all services in the docker-compose file and detach from the terminal. So your services can run in background.

  1. docker-compose start

Stop all services

Corresponding stop command

  1. docker-compose stop

Launch a specific service

This will only launch njs1 from the list of services in the docker-compose.yml

  1. docker-compose up

Restart a single service

  1. docker-compose restart

logs from specific service

This will show logs of only njs1 and also watch for more logs

  1. docker-compose logs -f

ssh into a particular service container

6 docker-compose exec bash

Low on space / messed up and want to restart everything from scratch ? Removing all images and then refreshing the entire thing.

To remove all docker containers:

  • docker rm $(docker ps -a -q) -f

To remove all docker images:

  • docker rmi $(docker images) -f