Hi I am trying to deploy a grafana docker container to a google app engine flex. Grafana will use postgresql (cloud sql) as internal database.
I am currently using this Dockefile:
FROM grafana/grafana:latest
ENV GF_SERVER_HTTP_PORT 8080
ENV GF_DATABASE_URL postgres://postgres:passwd@127.0.0.1:5432/grafana
ENV GF_DATABASE_TYPE postgres
EXPOSE 8080
and this app.yaml:
runtime: custom
env: flex
service: grafana
beta_settings:
cloud_sql_instances: miproj:europe-west1:midb=tcp:5432
I have also activated the Cloud SQL Admin API
After doing
gcloud app deploy
however I get
msg="Server shutdown" logger=server reason="Service init failed: Migration failed err: dial tcp 127.0.0.1:5432: connect: connection refused"
I have also tried
cloud_sql_instances: miproj:europe-west1:midb
and
ENV GF_DATABASE_URL postgres://postgres:passwd@/cloudsql/miproj:europe-west1:midb:5432/grafana
but I get
t=2019-05-09T10:12:56+0000 lvl=eror msg="Server shutdown" logger=server reason="Service init failed: Migration failed err: dial tcp: lookup port=5432: no such host"
but I think this might be more a problem of how grafana parses a connection chain which has ":" in the middle of the host name.
Any ideas of what am I doing wrong?