Support one-line deployments to Railway, fully featured #1155
Closed
OlegGulevskyy
started this conversation in
Feature suggestions / feedback
Replies: 2 comments
-
Thanks for documenting this @OlegGulevskyy , and for turning this into a PR: #1157 Will take a look soon, much appreciated!! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Closing as we turned it into an issue: #1232 . |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As subject suggests, I think there is nice area for improvement - allow users to deploy Wasp to Railway in a matter of few commands (lesser - the better).
Docs are already covering this topic, on how to deploy to Railway, but there is more to it than suggested in docs, and covering this in docs is cumbersome and just too much to ask devs to do it all the time manually.
The main process described in the docs is the same (meaning, commands to navigate between dirs and deploy do not change).
Currently the issue with Railway deployments is that Railway does not support SPAs routing. You can deploy a SPA with one single route just fine, but, if you use something like
react-router
, then your routes will be broken by displaying404
on each of them.As described here, what seems to be the issue is
nginx
does not resolve correctly requested path, so its configuration has to be overwritten to redirect requests to/index.html
, where react-router handles requests itself. I am not an expert on the subject and have very limited understanding on why and how this exactly works, but with X hours spent on trying to go around it, here is what worked for me.The idea here is that the entire app is deployed inside Docker container and it takes some
nginx
configuration file with it to the server, therefore few files additionally have to be created by Wasp during deployment.wasp
project is built by runningwasp build
in the project dir/.wasp/build/web-app
and create 2 files:FROM nginx:1.19.10-alpine
specific version, as using anything other than that threw a lot of exceptions on the server :\ )/.nginx
inside theweb-app
dir.nginx.conf
inside/.nginx
dir with contentclient
service in Railway has env variablePORT
set to8080
tsc
inweb-app/package.json
file, inbuild
command as it was failing Docker to deploy things due to typing issues. But this should be handled in a different way (by making sure stuff inside Docker is aware of types)railway up
The issue I see is that railway up is running in interactive mode if there are multiple services available, which potentially might be unexpected and I think it's best if it is possible to target a specific service without interactive mode (for CI/CD, for example?) I am enquiring if it's possible to do exactly that.
Let me know your thoughts and I'd be hyped to see this available as one-liner!
I'd be also happy to implement this logic myself, but haskell is a show stopper for me at the moment
Beta Was this translation helpful? Give feedback.
All reactions