Skip to content

JulianoCosta/Node-API-Docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node-API-Docker

Simple Restful Api with Node.js

Technologies

  • Node.js
    • Express.js
    • Knex.js
    • JWT / Passport
    • Consign
  • Postgres
  • Docker
    • Dockerfile
    • docker-compose
  • Jest
    • supertest
  • Nginx

Diagram

diagram

Requirements

Applications that need to be installed in the development environment:

  • node
  • npm
  • docker

Commands

  • Install dependencies on "/app" and "/load_test":

    $ npm i

  • Create and execute all containers on port 80 (nginx), on root folder:

    $ docker-compose up

    $ docker-compose down (to stop and delete the containers)

  • Run api locally on port 3000 (node):

    $ cd app

    $ npm start

  • Run tests locally:

    $ cd app

    $ npm test

  • Run load_test:

    • Initialize the containers:

      $ docker-compose up -d (root folder, -d run in background)

    • Initialize the load test:

      $ cd load_test

      $ npm start

    • And in another terminal, launch real-time monitoring:

      $ docker stats