-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to remote access to postgres within the carto container #64
Comments
The "carto_db_development" is the central db and used for user management. The carto server is running in development mode, that is why the database is called "carto_db_development". The So to connect to a database of a user for example docker exec -ti <name of carto container> bash
USER_DB=`echo "SELECT database_name FROM users WHERE username='dev'" | psql -U postgres -t carto_db_development`
psql -U postgres $USER_DB |
Thanks a lot Mr.Sverhoeven, this really helps !!! By the way, is there any way to access to postgresql in the container from outside apps ? I saw an older thread where it said it's not possible ?? Actually is it possible to modify the DOCKFILE, from "EXPOSE 80" to "EXPOSE 80 5432" and then rebuild to achieve this ? Thank you |
The current Dockerfile uses the default PostgreSQL configuration which does not allow remote PostgreSQL connections. So the PostgreSQL configuration needs to be changed as well as exposing 5432 in Docker. |
Hi Serhoeven, I've investigated the final solution which I would like to share to everyone.
This will work !!!! And we can access to pg within carto container via port 5431. |
Hi Sverhoeven,
May I ask what is the dbname, username and password to access to the postgresql inside the docker ? I found "carto_db_development', 'postgres' and '' in the config file, which seems to be not right ?
Thanks
The text was updated successfully, but these errors were encountered: