I use the docker in this part of the application because I use two pcs for development and if other people wanted to help me, then I need an automated process to start the database, I will use knexjs to run seeds, migrations, so I decided to use the docker, but I still don't have a deep knowledge of the docker, this is a simple use of the docker
-
after install docker ...
-
i use postgre 12.3, 12, latest
-
this script sequence for create db
-
Windows
docker pull postgres
docker run --name postgreDB -e POSTGRES_PASSWORD=admin -e POSTGRES_USER=admin -d -p 5432:5432 postgres
- Ubuntu
sudo docker pull postgres
docker run --name postgreDB -e POSTGRES_PASSWORD=admin -e POSTGRES_USER=admin -d -p 5432:5432 postgres
-
use cli postgre( Query CLI )
docker exec -it postgreDB psql -U admin --password
-
after entry in cli postgre, create db
create database genericSign;
-
then run
npm run knex:migrate