Hoe maak je verbinding met een externe database die op localhost draait

AI-generated summary

isaac1104 is developing Discourse on macOS using Docker and wants to enable login via an external PostgreSQL users table running locally. They tried the Official Single-Sign-On for Discourse (sso) and running Discourse with a separate PostgreSQL server methods but faced issues, likely due to Docker networking. simon suggested installing Discourse directly on macOS (without Docker) using this guide, which places Discourse at http://localhost:3000 and simplifies SSO setup. isaac1104 confirmed this solution worked for them.

Hello,

I have installed discourse on macbook for development using the “beginners-guide-to-install-discourse-for-development-using-docker” instruction.

Now, I have a separate postgreSQL database with users table that contains all the users’ information for my other web app.

My question is, is it possible to login to discourse using that separate users table that is running locally on my macbook?

I tried the Setup DiscourseConnect - Official Single-Sign-On for Discourse (sso) method but I wasn’t able to get this to work because it seems like this method is for production and also tried Configure Discourse to use a separate PostgreSQL server - #24 by hydrandt method but no luck there either.

I have attached a very basic diagram of what I would like to do for a better understanding.

If you need any further information, please let me know.

Thank you!

You can get SSO to work in a local development environment, but it might be difficult to configure it to work with the Docker development environment. You could try installing Discourse without Docker on your Mac by following this guide: Install Discourse on macOS for development. With that setup, your Discourse site will be on http://localhost:3000. You’ll be able to make SSO requests directly to it without having to deal with networking issues.

This worked for me. Thank you!