In order to run the project you need Docker and Docker Compose
, if you already have them installed you can skip the step 1 and 2.
- Install Docker in your machine for your corresponding OS.
- Verify your installation. Run:
$ docker --version
Docker version 17.03.0-ce, build 60ccb23
- Install Docker Compose in your machine for your corresponding OS.
- Verify your installation. Run:
$ docker-compose --version
docker-compose version 1.22.0, build 1719ceb
$ git clone [email protected]:Roberto4091/express-js-docker.git
$ cd express-js-docker
$ cp ./.env.example ./docker/.env
$ docker-compose -f docker/docker-compose.yml build
$ docker-compose -f docker/docker-compose.yml up
Then go to http://localhost:8000
.
Create new model and migration
$ docker-compose -f docker/docker-compose.yml run example_dev npm run model:generate -- --name MODEL_NAME --attributes THE_ATTRIBUTE:TYPE
Apply migrations
$ docker-compose -f docker/docker-compose.yml run example_dev npm run migrate
Create seed
$ docker-compose -f docker/docker-compose.yml run example_dev npm run seed:generate -- --name SEED_NAME
Run seeds
$ docker-compose -f docker/docker-compose.yml run example_dev npm run seed