From 8eaa2c1f7d87c45efef2dd724c7c414db3a6b180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Rodri=CC=81guez?= Date: Tue, 5 Nov 2019 18:53:09 +0100 Subject: [PATCH 1/2] Add POSTGRES_DB_NAME documentation * Document a new environment variable available to configure the database name. --- geonetwork/variant-postgres.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/geonetwork/variant-postgres.md b/geonetwork/variant-postgres.md index 50f7a6033..c7b6c34a1 100644 --- a/geonetwork/variant-postgres.md +++ b/geonetwork/variant-postgres.md @@ -15,7 +15,7 @@ If you want to connect to a postgres server, you need to pass an extra environme If you want to connect to an **external database server**, you can use either the IP address or the DNS as `POSTGRES_DB_HOST`. For instance, if the server is running on `mydns.net`, on port `5434`, the username is `postgres` and the password is `mysecretpassword`: ```console -$ docker run --name geonetwork -d -p 8080:8080 -e POSTGRES_DB_HOST=mydns.net -e POSTGRES_DB_PORT=5434 -e POSTGRES_DB_USERNAME=postgres -e POSTGRES_DB_PASSWORD=mysecretpassword geonetwork:postgres +$ docker run --name geonetwork -d -p 8080:8080 -e POSTGRES_DB_HOST=mydns.net -e POSTGRES_DB_PORT=5434 -e POSTGRES_DB_USERNAME=postgres -e POSTGRES_DB_PASSWORD=mysecretpassword -e POSTGRES_DB_NAME=mydbname geonetwork:postgres ``` If are want to **run postgres on a container**, you can use the container name as `POSTGRES_DB_HOST`: just make sure that containers can discover each other, by **running them in the same user-defined network**. For instance, you can create a bridge network: @@ -33,5 +33,14 @@ $ docker run --name some-postgres --network=mynet -d postgres And then you could launch geonetwork, making sure you join the same network, and setting the required environment variables, including the `POSTGRES_DB_HOST`: ```console -$ docker run --name geonetwork -d -p 8080:8080 --network=mynet -e POSTGRES_DB_HOST=some-postgres -e POSTGRES_DB_PORT=5432 -e POSTGRES_DB_USERNAME=postgres -e POSTGRES_DB_PASSWORD=mysecretpassword geonetwork:postgres +$ docker run --name geonetwork -d -p 8080:8080 --network=mynet -e POSTGRES_DB_HOST=some-postgres -e POSTGRES_DB_PORT=5432 -e POSTGRES_DB_USERNAME=postgres -e POSTGRES_DB_PASSWORD=mysecretpassword -e POSTGRES_DB_NAME=mydbname geonetwork:postgres ``` +#### Configuration environment variables + +These are some environments variables that can be set to configure the database connection: + +* `POSTGRES_DB_HOST`: database host name. +* `POSTGRES_DB_PORT`: port where database server is listening (by default `5432`). +* `POSTGRES_DB_NAME`: name of the database. If it doesn't exists the container will try to create it. +* `POSTGRES_DB_USERNAME`: username. +* `POSTGRES_DB_PASSWORD`: password. From 829deb4fd954ba73ae52514b2be2721e241c21a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Rodri=CC=81guez?= Date: Tue, 5 Nov 2019 23:13:31 +0100 Subject: [PATCH 2/2] Apply formatting fixes --- geonetwork/variant-postgres.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/geonetwork/variant-postgres.md b/geonetwork/variant-postgres.md index c7b6c34a1..c98907ff8 100644 --- a/geonetwork/variant-postgres.md +++ b/geonetwork/variant-postgres.md @@ -35,12 +35,13 @@ And then you could launch geonetwork, making sure you join the same network, and ```console $ docker run --name geonetwork -d -p 8080:8080 --network=mynet -e POSTGRES_DB_HOST=some-postgres -e POSTGRES_DB_PORT=5432 -e POSTGRES_DB_USERNAME=postgres -e POSTGRES_DB_PASSWORD=mysecretpassword -e POSTGRES_DB_NAME=mydbname geonetwork:postgres ``` + #### Configuration environment variables These are some environments variables that can be set to configure the database connection: -* `POSTGRES_DB_HOST`: database host name. -* `POSTGRES_DB_PORT`: port where database server is listening (by default `5432`). -* `POSTGRES_DB_NAME`: name of the database. If it doesn't exists the container will try to create it. -* `POSTGRES_DB_USERNAME`: username. -* `POSTGRES_DB_PASSWORD`: password. +- `POSTGRES_DB_HOST`: database host name. +- `POSTGRES_DB_PORT`: port where database server is listening (by default `5432`). +- `POSTGRES_DB_NAME`: name of the database. If it doesn't exist the container will try to create it. +- `POSTGRES_DB_USERNAME`: username. +- `POSTGRES_DB_PASSWORD`: password.