Launch an App Without a Database

Previously, the fly launch command allowed me to create an app without attaching a database, enabling the addition of a database later. However, the current behavior of the command automatically adds a custom database configuration to the PostgreSQL option.

In my organization, we deploy pull request preview apps that share a single database cluster. Since the fly launch command lacks a flag like –db=none or –skip-db, I’m unsure how to proceed in this scenario. Any guidance on a workaround would be greatly appreciated.

1 Like

@davidudo one workaround is to not use fly launch and instead perform the steps separately which will give you more control.

First you probably want to use fly apps create · Fly Docs, then fly ips allocate v4 · Fly Docs or fly ips allocate v6 · Fly Docs depending on your needs, then fly secrets set · Fly Docs to configure secrets if any, finally fly deploy · Fly Docs to get everything deployed and running.

Thank you @charsleysa

Having the database attach by default is strange, it’s making an assumption about my stack. In my opinion it should be opt-in rather than opt-out. fly launch --db postgres

Without knowing anything about your stack, I can’t comment further, but fly launch does NOT automatically assume Postgres. We have a number of framework specific scanners, and a number of them attempt to determine if your application is using Postgres, and if such a scanner detects such use, postgres will part of the original recommendation, and something you can override via the web UI.

That’s helpful to know, thanks. Still, would be great to have this turned off by default so I don’t have to override it in the web UI.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.