I get the same errors with the phoenix / elixir application that I try to exit the container and into the flexible environment of the application engine, I just canβt figure out what to use as the host name.
in my application php in the application engine i can just use :/cloudsql/projectname:region:dbnamefor the same database but it doesn't seem to work for elixir
I also tried directly using the IP address of the sql sql instance, but it didn't work either.
in my app.yaml i have
env_variables:
MIX_ENV: staging
port: 8080
DB_ENV_POSTGRES_HOST: :/cloudsql/projectname:region:dbame
DB_ENV_POSTGRES_USER: userman
DB_ENV_POSTGRES_PASSWORD: password
and in conf/staging.exsi
config :guidebooks_api, GuidebooksApi.Repo,
adapter: Ecto.Adapters.Postgres,
username: System.get_env("DB_ENV_POSTGRES_USER") || "postgres",
password: System.get_env("DB_ENV_POSTGRES_PASSWORD") || "postgres",
hostname: System.get_env("DB_ENV_POSTGRES_HOST") || "localhost",
database: "databasename",
pool_size: 10,
types: GuidebooksApi.PostgresTypes
source
share