railway.mdx 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ---
  2. title: 'Railway.app'
  3. description: 'Deploy your RAG application to railway.app'
  4. ---
  5. It's easy to host your Embedchain-powered apps and APIs on railway.
  6. Follow the instructions given below to deploy your first application quickly:
  7. ## Step-1: Create RAG app
  8. ```bash Install embedchain
  9. pip install embedchain
  10. ```
  11. <Tip>
  12. **Create a full stack app using Embedchain CLI**
  13. To use your hosted embedchain RAG app, you can easily set up a FastAPI server that can be used anywhere.
  14. To easily set up a FastAPI server, check out [Get started with Full stack](https://docs.embedchain.ai/get-started/full-stack) page.
  15. Hosting this server on railway is super easy!
  16. </Tip>
  17. ## Step-2: Set up your project
  18. ### With Docker
  19. You can create a `Dockerfile` in the root of the project, with all the instructions. However, this method is sometimes slower in deployment.
  20. ### Without Docker
  21. By default, Railway uses Python 3.7. Embedchain requires the python version to be >3.9 in order to install.
  22. To fix this, create a `.python-version` file in the root directory of your project and specify the correct version
  23. ```bash .python-version
  24. 3.10
  25. ```
  26. You also need to create a `requirements.txt` file to specify the requirements.
  27. ```bash requirements.txt
  28. python-dotenv
  29. embedchain
  30. fastapi==0.108.0
  31. uvicorn==0.25.0
  32. embedchain
  33. beautifulsoup4
  34. sentence-transformers
  35. ```
  36. ## Step-3: Deploy to Railway 🚀
  37. 1. Go to https://railway.app and create an account.
  38. 2. Create a project by clicking on the "Start a new project" button
  39. ### With Github
  40. Select `Empty Project` or `Deploy from Github Repo`.
  41. You should be all set!
  42. ### Without Github
  43. You can also use the railway CLI to deploy your apps from the terminal, if you don't want to connect a git repository.
  44. To do this, just run this command in your terminal
  45. ```bash Install and set up railway CLI
  46. npm i -g @railway/cli
  47. railway login
  48. railway link [projectID]
  49. ```
  50. Finally, run `railway up` to deploy your app.
  51. ```bash Deploy
  52. railway up
  53. ```
  54. ## Seeking help?
  55. If you run into issues with deployment, please feel free to reach out to us via any of the following methods:
  56. <Snippet file="get-help.mdx" />