Document how to connect to postgresql
This commit is contained in:
parent
82f20e6354
commit
21055e669a
11
README.md
11
README.md
|
@ -218,6 +218,17 @@ If any step of the instructions does not work for you, please open an issue and
|
||||||
describe the problem you're having, as it is important to us that onboarding is
|
describe the problem you're having, as it is important to us that onboarding is
|
||||||
super easy :)
|
super easy :)
|
||||||
|
|
||||||
|
### Connecting to the PostgreSQL database
|
||||||
|
|
||||||
|
If you need to connect to your development PostgreSQL database, you should
|
||||||
|
install `psql` locally. The port 5432 is already forwarded, so you can connect with:
|
||||||
|
|
||||||
|
```
|
||||||
|
psql -h localhost -U obs -d obs
|
||||||
|
```
|
||||||
|
|
||||||
|
The password is `obs` as well.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Copyright (C) 2020-2021 OpenBikeSensor Contributors
|
Copyright (C) 2020-2021 OpenBikeSensor Contributors
|
||||||
|
|
|
@ -402,3 +402,26 @@ exporting that with an exclusion pattern instead of an explicit list.
|
||||||
|
|
||||||
And then, please test your backup and restore strategy before going live, or at
|
And then, please test your backup and restore strategy before going live, or at
|
||||||
least before you need it!
|
least before you need it!
|
||||||
|
|
||||||
|
|
||||||
|
### Connecting to the PostgreSQL database
|
||||||
|
|
||||||
|
Here are the quick steps for connecting to your PostgreSQL database, should you
|
||||||
|
need that:
|
||||||
|
|
||||||
|
* Add the `gateway` network to your `postgres` service.
|
||||||
|
* Add a port forwarding to your `postgres` service:
|
||||||
|
```yaml
|
||||||
|
ports:
|
||||||
|
- 127.0.0.1:25432:5432
|
||||||
|
```
|
||||||
|
* Run `docker-compose up -d postgres` again
|
||||||
|
* You can now connect from your server to the PostgreSQL service with:
|
||||||
|
|
||||||
|
```
|
||||||
|
psql -h localhost -U obs -d obs -p 25432
|
||||||
|
```
|
||||||
|
|
||||||
|
You will need your database password for the connection.
|
||||||
|
* If you do not want to install `psql` outside your container, you can use an
|
||||||
|
SSH tunnel from your local machine to your server and run `psql` locally.
|
||||||
|
|
Loading…
Reference in a new issue