Skip to content

markterence/docker-sailsjs-example

Repository files navigation

docker-sailsjs-example

  • This uses wait-for-it.sh
    Run the following commands to get wait-for-it repository. (Added wait-for-it as git submodule.)
git pull && git submodule init && git submodule update

Container and Images

FROM node:8.11.3

  • container
    container-big
  • image
    image-big

FROM node:8.11.3-alpine

  • container
    container-big
  • image
    image-big

todo-server

  • Environment Variables for todo-server
Name Description
PORT application port
DB_HOST MySQL host
DB_USER MySQL username (must have alter permission)
DB_PASSWORD MySQL password
DB_DATABASE Database name
NODE_ENV sails js environment mode (production, development , alterdb). 'alterdb' by default to create tables. )O- O)\
  • Ports
    • 1350 - api server
# build the containers, start it in de-attached mode. (runs in background).
docker-compose up --build -d

# list all (including stopped) containers, it should contain
# `todo-nodejs` and `todo-nodejs-mariadb`
docker container ls -a

# list running containers
docker ps

# destroy container and volume
docker-compose down -v

# destroy image
docker image rm <SHA>

# start or stop a container
docker container start <CONTAINER_NAME>
docker container stop <CONTAINER_NAME>

mariadb: storage of your database data