a year ago
So my project is a React frontend and my backend is Flask.
I understand that I should deploy theses as two different services in railway even thought they are in the same repo (backend and frontend folder)
I'm just unsure as to how to deploy the frontend since it's just a build.
I would like to know the steps needed to make it happen (settings I need to use in both services.)
Thanks in advance.
7 Replies
a year ago
Hello,
Are you able to share your repo so I can make suggestions on what needs to be changed?
a year ago
Hi! Yes, I send you an invite trough GitHub.
I'm wondering if i should just but the dist folder in my backend and only run the backend ?
a year ago
That's a possibility but I personally don't like that solution.
Will look at the repo.
a year ago
Yeah, neither do I.
Let me know, i would love your help.
a year ago
I see a few things wrong with the repo -
Frontend -
- You are commiting your dist folder, please remove that from the repo and make sure it's in your .gitignore
- You are attempting to run a dev server - https://github.com/brody192/vite-react-template - copy the nixpacks.toml and Caddyfile from this repo into your frontend.
Backend -
- Missing a railway.json file -
{
"$schema": "https://railway.app/railway.schema.json",
"deploy": {
"runtime": "V2",
"numReplicas": 1,
"startCommand": "gunicorn wsgi:appcontext",
"sleepApplication": false,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}Once you have these done, follow this guide - https://docs.railway.app/tutorials/deploying-a-monorepo
a year ago
Wow! You're a life saver. Thank you so much!
It works so well! Appreciate it
Status changed to Solved brody • over 1 year ago