Improve docker install examples
Removes the PGRST_DB_SCHEMA variable which is public by default now. Removes the PGRST_DB_ANON_ROLE variable, because using the authenticator role or even a superuser is very bad practice. Replaces the postgres superuser with app_user, because using a superuser to connect to postgres is very bad practice. Signed-off-by: Wolfgang Walther <walther@technowledgy.de>
This commit is contained in:
committed by
Wolfgang Walther
parent
a85dfe9558
commit
a4db05aeba
+1
-5
@@ -130,9 +130,7 @@ The first way to run PostgREST in Docker is to connect it to an existing native
|
|||||||
|
|
||||||
# Run the server
|
# Run the server
|
||||||
docker run --rm --net=host -p 3000:3000 \
|
docker run --rm --net=host -p 3000:3000 \
|
||||||
-e PGRST_DB_URI="postgres://postgres@localhost/postgres" \
|
-e PGRST_DB_URI="postgres://app_user:password@localhost/postgres" \
|
||||||
-e PGRST_DB_SCHEMA="public" \
|
|
||||||
-e PGRST_DB_ANON_ROLE="postgres" \
|
|
||||||
postgrest/postgrest
|
postgrest/postgrest
|
||||||
|
|
||||||
The database connection string above is just an example. Adjust the role and password as necessary. You may need to edit PostgreSQL's :code:`pg_hba.conf` to grant the user local login access.
|
The database connection string above is just an example. Adjust the role and password as necessary. You may need to edit PostgreSQL's :code:`pg_hba.conf` to grant the user local login access.
|
||||||
@@ -176,8 +174,6 @@ To avoid having to install the database at all, you can run both it and the serv
|
|||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
environment:
|
environment:
|
||||||
PGRST_DB_URI: postgres://app_user:password@db:5432/app_db
|
PGRST_DB_URI: postgres://app_user:password@db:5432/app_db
|
||||||
PGRST_DB_SCHEMA: public
|
|
||||||
PGRST_DB_ANON_ROLE: app_user #In production this role should not be the same as the one used for the connection
|
|
||||||
PGRST_OPENAPI_SERVER_PROXY_URI: http://127.0.0.1:3000
|
PGRST_OPENAPI_SERVER_PROXY_URI: http://127.0.0.1:3000
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
|
|||||||
Reference in New Issue
Block a user