Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions db/setup.sh
Original file line number Diff line number Diff line change
@@ -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