@flamber, thanks for suggestions. Some attempts:
Have you tried
%3A instead of colon
Yes. I set
postgres://user:pwd@/dbname?host=/cloudsql/project%3Aregion%3Aproject/, but Metabase seems to ignore this and reverts to H2 without throwing any exceptions.
That looks like you can make a string like this:
I think this works if you’ve included the relevant Google Cloud libraries in the jar itself, but I don’t know how to do that.
…but maybe you could do a workaround with a TCP forward
This worked for me, finally!
I made my own Dockerfile like this:
RUN apk update
RUN apk add --no-cache socat
# Set up symlink to Cloud SQL UNIX socket
RUN ln -s /cloudsql/<instance-name-goes-here>/.s.PGSQL.5432 pg.sock
COPY startup.sh startup.sh
RUN chmod +x startup.sh
… where ./startup.sh looks like:
# Forward TCP:5432 to Cloud SQL Unix socket
nohup socat -d -d TCP4-LISTEN:5432,fork UNIX-CONNECT:pg.sock &
# Runs Metabase
I still had to use a symlink because even
socat can’t handle paths that contain