I’m using a PostGIS extension on postgres. Is it possible to do this with fly’s postgres support? So far I’ve just used a plain Dockerfile instead, but I’d prefer to use a fly-based instance if possible, so i get the built-in features of flyctl postgres .
A specific problem I’m having is it’s awkward to pass the DB credentials into the build-phase (for a DB migration), but I believe if I had postgres ‘attached’ to the app via flyctl, it would do that for me
PostGIS is built into our Postgres apps, so you should be set.
If you need extra extensions, you can actually fork our app and deploy update your own postgres with it.
That said, you shouldn’t do migrations in builds. We have a release_command feature that will run in the context of your app (secrets, ENV vars, etc) and is designed to let you do DB migrations: App Configuration (fly.toml) · Fly Docs
Migrations with Fly Postgres work identically, attach just automates a lot of what you probably did by hand.
Oh wow that’s great. I didn’t realize PostGIS is built in!
That said, you shouldn’t do migrations in builds. We have a release_command feature that will run in the context of your app (secrets, ENV vars, etc) and
The release_command doesn’t have the runtime secrets in it, unless I’m doing something really wrong… That’s actually a core part of my problem. Can you confirm?
Thanks for the quick responses. I got all the pieces up and running for our DB and app Docker images now, with a frontend pipeline build, migrations (in the deploy step as you said), etc. Fly.io is great!
FYI It was definitely a lack of env variables - I was printing them out to observe. But I tried again after your message, and everything was fine, so maybe I was actually looking at messages from the builder instead of the deploy cmd??