-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add --db-image
argument to wasp deploy railway
#3184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
97d94ee
to
eb43689
Compare
eb43689
to
00b0ad6
Compare
wasp deploy railway
wasp deploy railway
--db-image
argument to wasp deploy railway
Deploying wasp-docs-on-main with
|
Latest commit: |
c682352
|
Status: | ✅ Deploy successful! |
Preview URL: | https://ea2f1a97.wasp-docs-on-main.pages.dev |
Branch Preview URL: | https://image-arg-for-deploy-railway.wasp-docs-on-main.pages.dev |
This reverts commit 7a84c2a.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just text/docs changes.
waspc/packages/deploy/src/providers/railway/commands/setup/setup.ts
Outdated
Show resolved
Hide resolved
waspc/packages/deploy/src/providers/railway/commands/setup/setup.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed but didn't search for "what is missing", just reviewed what I see!
waspc/packages/deploy/src/providers/railway/commands/setup/SetupCmdOptions.ts
Show resolved
Hide resolved
waspc/packages/deploy/src/providers/railway/commands/setup/setup.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 (if applicable):
|
||
### 🔧 Small improvements | ||
|
||
- You can now specify which PostgreSQL image to use in `wasp deploy railway` with the `--db-image` argument. ([#3184](https://github.com/wasp-lang/wasp/pull/3184)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I'd list this as a feature :)
Btw, please bump the version in waspc.cabal to 0.18.1
.
I haven't yet delieverd the post mortem and made my case for this, so just trust me bro :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will wait until we decided on the postmortem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we decided we want to bump right away, does this make this comment actionable now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it on here since I don't want to mix concerns in the same PR, we can merge that one first
#3236
Co-authored-by: Franjo Mindek <84568328+FranjoMindek@users.noreply.github.com>
Co-authored-by: Franjo Mindek <84568328+FranjoMindek@users.noreply.github.com>
Co-authored-by: Franjo Mindek <84568328+FranjoMindek@users.noreply.github.com>
Co-authored-by: Franjo Mindek <84568328+FranjoMindek@users.noreply.github.com>
Co-authored-by: Franjo Mindek <84568328+FranjoMindek@users.noreply.github.com>
ready @sodic @Martinsos @FranjoMindek |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments
By default, Wasp uses the standard PostgreSQL image provided by Railway when creating a new database for your app. However, if your application requires specific PostgreSQL extensions (e.g., PostGIS), you can specify a Docker image with a custom PostgreSQL installation, with the `--db-image <docker-image>` flag. | ||
|
||
:::tip | ||
You only need to specify the Docker image once, when first creating the app. | ||
::: | ||
|
||
```shell | ||
# Use PostGIS: | ||
wasp deploy railway launch my-wasp-app --db-image postgis/postgis | ||
``` | ||
|
||
```shell | ||
# Use pgvector: | ||
wasp deploy railway launch my-wasp-app --db-image pgvector/pgvector:pg16 | ||
``` | ||
|
||
The service name will always be `Postgres`, regardless of the image used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these texts are repeated verbatim - let's extract them into a partial and include in both places.
|
||
### 🔧 Small improvements | ||
|
||
- You can now specify which PostgreSQL image to use in `wasp deploy railway` with the `--db-image` argument. ([#3184](https://github.com/wasp-lang/wasp/pull/3184)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we decided we want to bump right away, does this make this comment actionable now?
"--variables", | ||
"PGDATA=/var/lib/postgresql/data/pgdata", | ||
"--variables", | ||
"DATABASE_URL=postgresql://${{POSTGRES_USER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:${{PORT}}/${{POSTGRES_DB}}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd reuse the getRailwayEnvVarValueReference
helper for these Railway env var references 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I did it, but tbh I don't think we're winning much by using it, on the contrary making it more difficult to read the variable. Check it out and tell me what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel it's more readable now because it's quite explicit about what's going on. Either way, I'd keep it consistent now with the other place where we use env var references - at least when we decide to refactor it, there won't be two different ways of doing things.
@infomiho ready |
Unsubscribing myself and leaving it to miho |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adds an optional
--db-image
argument to thewasp deploy railway {launch,setup}
command, allowing the user to specify a custom Docker image for the database.Their default Postgres service only allows adding extensions through the web interface, and only a few "blessed" ones (e.g. neither
PostGIS
orpgvector
are available). If you want it any other way, you must deploy the image while setting the env variables yourself. For those, I copied Miho's already-running ask-the-documents app on Railway, and everything seems work correctly.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