mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-08 00:28:16 -06:00
Add section on spinning up Postgresql in Docker
This commit is contained in:
parent
34259d5d9d
commit
67c13506b6
@ -41,6 +41,21 @@ Then, start the service and enable it to run at boot:
|
|||||||
# systemctl enable postgresql-9.6
|
# systemctl enable postgresql-9.6
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Docker**
|
||||||
|
|
||||||
|
The simplest way to quickly deploy a Postgresql server is to run it in a [Docker](https://www.docker.com) container. This is
|
||||||
|
most ideal for development and testing environments however, and should be used with caution for any intended use in
|
||||||
|
production.
|
||||||
|
|
||||||
|
An instance of Postgresql can be spun up quickly with:
|
||||||
|
|
||||||
|
```no-highlight
|
||||||
|
$ docker run -d -p 5432:5432 --name postgres-netbox postgres:9.6
|
||||||
|
```
|
||||||
|
|
||||||
|
Further details of how to use Docker are outside the scope of this document. Please refer to the
|
||||||
|
[Docker documentation](https://docs.docker.com) for more information.
|
||||||
|
|
||||||
# Database Creation
|
# Database Creation
|
||||||
|
|
||||||
At a minimum, we need to create a database for NetBox and assign it a username and password for authentication. This is done with the following commands.
|
At a minimum, we need to create a database for NetBox and assign it a username and password for authentication. This is done with the following commands.
|
||||||
@ -48,6 +63,9 @@ At a minimum, we need to create a database for NetBox and assign it a username a
|
|||||||
!!! danger
|
!!! danger
|
||||||
DO NOT USE THE PASSWORD FROM THE EXAMPLE.
|
DO NOT USE THE PASSWORD FROM THE EXAMPLE.
|
||||||
|
|
||||||
|
!!! note
|
||||||
|
To connect to a Docker instance of Postgresql, instead use the command `$ psql -u postgres -H localhost`.
|
||||||
|
|
||||||
```no-highlight
|
```no-highlight
|
||||||
# sudo -u postgres psql
|
# sudo -u postgres psql
|
||||||
psql (9.4.5)
|
psql (9.4.5)
|
||||||
|
Loading…
Reference in New Issue
Block a user