diff --git a/README.md b/README.md index a627c18..7c9b463 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,24 @@ let's start with - Ask questions in https://t.me/nodeua and post issues on [github](https://github.com/HowProgrammingWorks/NodejsStarterKit/issues) +## Quick installation with docker + +- Run docker command for postgres + +```sh + docker run --name pg_test -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -d postgres +``` + +- Run to prepare database + +```sh + docker cp ./db/install.sql pg_test:/install.sql + docker cp ./db/data.sql pg_test:/data.sql + docker cp ./db/structure.sql pg_test:/structure.sql + docker cp ./db/setup.sh pg_test:/setup.sh + docker exec -it pg_test sh setup.sh +``` + ## License Copyright (c) 2020-2022 Metarhia contributors. diff --git a/db/setup.sh b/db/setup.sh index 5e36c2b..eade713 100755 --- a/db/setup.sh +++ b/db/setup.sh @@ -1,3 +1,3 @@ -psql -f install.sql -U postgres -PGPASSWORD=marcus psql -d application -f structure.sql -U marcus -PGPASSWORD=marcus psql -d application -f data.sql -U marcus +PGPASSWORD=postgres psql -h 127.0.0.1 -f install.sql -U postgres +PGPASSWORD=marcus psql -h 127.0.0.1 -d application -f structure.sql -U marcus +PGPASSWORD=marcus psql -h 127.0.0.1 -d application -f data.sql -U marcus