I have been using GCP for a few days now but I am struggling to get my Ruby on Rails app to connect to Postgres hosted on Cloud SQL.
I have managed to connect locally via the cloud SQL proxy and execute migrations but I have not gotten past that.
Here is my database.yml production settings.
production:
<<: *default
adapter: postgresql
database: databasename
username: databaseuser
password: databasepassword
host: /cloudsql/project-name-172409:us-central1:application-name
Here is my app.yaml settings.
runtime: custom
env: flex
health_check:
enable_health_check: false
beta_settings:
cloud_sql_instances: project-name-172409:us-central1:application-name
env_variables:
SECRET_KEY_BASE: 121212
My custom docker file inherits from the base ruby build and executes migrations.
The error i get is this.
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting