User:Jtraulle/DiscourseMigration

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search

This page gathers info about Discourse migration.

Allow PostgreSQL to be accessed from an external application

Useful to be able to access the database from a graphical client (like pgAdmin 4, TablePlus or Postico for example).

1. Expose the 5432 TCP port from the container to the host by adding this line to the expose: section of containers/app.yml :

- "5432:5432"

2. Rebuild the container to take into account modifications to app.yml :

.launcher rebuild app

3. Enter into the container, login as the default postgresql user, add a new user and grant it all perms to the database

./launcher enter app
sudo -u postgres psql discourse
CREATE USER my_username WITH PASSWORD 'my_password';
GRANT ALL PRIVILEGES ON DATABASE "discourse" to my_username;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO my_username;
\q