In order to define all enrironments variables needed dockerUpScriptTemplate.example.sh file should be modified with proper values.
- Docker. Download and install it from Get Docker
- VirtualBox (optional but recommended).
Clone next repositories in the same container folder:
- cd into
express-base-api
folder and run:
npm install
- cd into
express-base-main
folder and run:
docker-compose up -d --build
*If you need to define evironments variables just define them before docker-compose command.
Example: SECRET_KEY=RunsWithFries docker-compose up -d --build
Optionally you can run docker machines withing an VirtualBox instance:
docker-machine create -d virtualbox <vm_name>
# Macke sure you run before last command! Each time you open a new terminal (either tab or window) you must eval again.
eval "$(docker-machine env <vm_name>)"
docker-compose up -d --build
docker-compose run base-api node_modules/.bin/sequelize db:drop
docker-compose run base-api node_modules/.bin/sequelize db:create
$ docker-compose run base-api sequelize db:migrate # Run pending migrations.
$ docker-compose run base-api sequelize db:migrate:undo # Revert the last migration run.
$ docker-compose run base-api sequelize help # Display this help text.
$ docker-compose run base-api sequelize migration:create # Generates a new migration file.
$ docker-compose run base-api sequelize init # Initializes the project.
$ docker-compose run base-api sequelize version # Prints the version number.