Skip to content

Conversation

cprecioso
Copy link
Member

@cprecioso cprecioso commented Sep 23, 2025

Adds an optional --db-image argument to the wasp deploy fly {launch,setup,create-db} command, allowing the user to specify a custom Docker image for the database.

This is part of #3174. We're adding ask-the-documents to the repo, which needs a specific PostgreSQL extension. This way we can more easily test the app.

Note

🤖 Generated with Claude Code
and 👨🏻 reviewed and edited by a person

@cprecioso cprecioso self-assigned this Sep 23, 2025
@cprecioso cprecioso changed the base branch from main to reorganize-fly-docs September 23, 2025 10:53
@cprecioso cprecioso marked this pull request as ready for review September 23, 2025 10:55
Copy link

cloudflare-workers-and-pages bot commented Sep 23, 2025

Deploying wasp-docs-on-main with  Cloudflare Pages  Cloudflare Pages

Latest commit: b40b727
Status: ✅  Deploy successful!
Preview URL: https://1d0cf46e.wasp-docs-on-main.pages.dev
Branch Preview URL: https://image-arg-for-deploy-fly.wasp-docs-on-main.pages.dev

View logs


## Using a Custom PostgreSQL Image

By default, Wasp uses the standard PostgreSQL image provided by Fly.io when creating a new database for your app. However, if your application requires specific PostgreSQL extensions (e.g., PostGIS), you can specify a custom PostgreSQL image during any of the commands that create a database.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only thing, I would try to standardize the text between here and railway.
#3184

There will be changes, but e.g. start of the explanation could be the same:

By default standard version by {provider}.. if want different because of e.g. plugins ... specify yourself...

Copy link
Member

@Martinsos Martinsos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, but I didn't dig into "is this correctly wired in all the places", I just look at the code changes and commented.
If you want somebody to check the first thing, probably best to have @infomiho take a look, or if you are confident, we can just go with it.

)
.option(
"--db-image <dbImage>",
"custom postgres image with extensions (must be based on flyio/postgres-flex)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make it clear it is Docker image.
Also, why "with extensions"? Does it need to have extensions, why would that be so?


If you want to build locally, supply the `--build-locally` option to `wasp deploy fly launch` or `wasp deploy fly deploy`.

## Using a Custom PostgreSQL Image
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Using a Custom PostgreSQL Image
## Using a Custom PostgreSQL Docker Image

I feel like we are not mentioning word Docker enough, we mostly just say image. That can be fine is context of Docker image is strongly established, but I don't think it is here, so I would at leats put it here in the title, to establish that context. ANd maybe I would even sprinkle Docker here and there below.

Comment on lines +201 to +203
wasp deploy fly create-db <region> --db-image <custom-postgres-image>
wasp deploy fly setup <app-name> <region> --db-image <custom-postgres-image>
wasp deploy fly launch <app-name> <region> --db-image <custom-postgres
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is me not knowing enough about how wasp deploy fly works, but what is the idea here, I need to keep repeating this argument for every command? How often do I need to repeat it, what does the workflow look like? How cumbersome / impractical is that -> it looks pretty impractical? What if they forget to pass it, what happens? If this is a problem, is there a better solution?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about discoverability -> I am person building a Wasp app, and I used postgres extensions. Now I want to deploy to Fly. How likely am I to see this new piece of docs about custom docker image on Fly?

I guess I will look for it explicitly because I will know I need a custom Docker image, right? In that case I think we are fine.

But another thought. Wouldn't it be cool if Wasp knew you are using a custom docker image for development already, with extensions, and then when you are doing deployment, it prompted you also to provide a custom docker image? Or maybe even reused the same one you used for development? That might be interesting hm. Although I guess it can't be the same image because Fly has some config it expects from it. ALthough we could use that image locally, why not, based on Fly's image. Hm. So maybe optimal solution would be to have a place in Wasp where one can define databaes image, and then that same image is used by default both during development and also when deploying the database. This is also good because you normally want the development environment to be as similar to production environment as possible.

This certainly shouldn't be happening in this issue, but I thought it is a good moment to think about this.

Copy link
Contributor

@sodic sodic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just like with Railway, There are plenty of reviewers here already so I won't take a detailed look unless you need me to.

I'll just say that this principle should also apply here:

Base automatically changed from reorganize-fly-docs to main September 24, 2025 16:08
@cprecioso cprecioso force-pushed the image-arg-for-deploy-fly branch from bb623d0 to 80afb7b Compare September 26, 2025 14:37
Co-authored-by: Martin Šošić <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants