AgileVentures / WebsiteOne

A website for Agile Ventures
https://www.agileventures.org
Other
143 stars 247 forks source link

Add support for google cloud #3821

Closed mattlindsey closed 1 year ago

mattlindsey commented 1 year ago

Modifications to allow running the site on docker locally and on Google Cloud.

It's currently dying on trying to connect to Google Cloud SQL postgres with this: PG::ConnectionBad: could not connect to server: No such file or directory

It seems to happen first when 'rake db:setup' tries to create the db and do migrations. And the postgres logs don't show it hitting the database. And the 'websiteone-production' db doesn't get created unless I do it manually.

I have checked a lot of things, and it may be a problem with the encrypted db password using the 'master key' method in rails, but I also seem to get the error just defining the password in the cloud service. Possibly the master key or 'rails secret key' didn't get saved correctly.

mtc2013 commented 1 year ago

have a look at this for sql issues

https://dev.to/ku6ryo/access-cloud-sql-from-docker-on-cloud-run-41b6

mattlindsey commented 1 year ago

Also this for postgres stuff needed https://dev.to/ku6ryo/access-cloud-sql-from-docker-on-cloud-run-41b6

mattlindsey commented 1 year ago

I think this looks good now. Turns out this doc was the latest/best way to do it, rather than the older 4 step tutorial which is more complicated: https://cloud.google.com/ruby/rails/run

mattlindsey commented 1 year ago

fixes #3819 fixes #3813

mattlindsey commented 1 year ago

@mtc2013. See it this looks good now. We should squash the commits when merging since there's so many.