It’s not running, and logs are empty!
That’s why I assumed there might be some restrictions with running background processes on fly.io (no IRC bouncers ;))
But if I login into the VM, execute the command by hand, and then log out, then it stays: man_shrugging:
So I moved lines starting the application & cloud sql proxy in the entry point script, and the effect is roughly the same - the sql proxy didn’t start, and logs are empty.
# Setup Cloud SQL Auth Proxy
RUN curl https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 > /usr/local/bin/cloud_sql_proxy
RUN chmod +x /usr/local/bin/cloud_sql_proxy
ADD deploy/entrypoint.prd.sh /usr/local/bin/entrypoint.prd.sh
USER nobody
ENTRYPOINT ["/usr/local/bin/entrypoint.prd.sh"]
#!/bin/sh
cd /app
/usr/local/bin/cloud_sql_proxy -instances=obfuscated-cloud-project-uri=tcp:127.0.0.1:5433 -credential_file=obfuscated-credentials-file.json >>/var/log/cloudsql.log 2>&1 &
doppler run -c prd -- /app/bin/server
Now, when I’m thinking about this, I’m leaning towards running Cloud SQL Proxy in a separate VM because this script is pretty naive and asks for production troubles.
Background processes are not an issue with fly. Look at this tutorial on how to run tailscale in your fly VM: Tailscale on Fly.io · Tailscale
Now set up something similar for your cloud_sql proxy.
Add it to Docker, replace the start script of your docker image and kick off the cloud_sql proxy before starting your real app. Pay close attention that you get paths, etc right.