embedchain/docs/deployment/fly_io.mdx
Embedchain has a nice and simple abstraction on top of the Fly.io tools to let developers deploy RAG application to fly.io platform seamlessly.
Follow the instructions given below to deploy your first application quickly:
curl -L https://fly.io/install.sh | sh
pwsh -Command "iwr https://fly.io/install.ps1 -useb | iex"
Once you have installed the fly.io cli tool, signup/login to their platform using the following command:
<CodeGroup> ```bash Sign up fly auth signup ```fly auth login
In case you run into issues, refer to official fly.io docs.
We provide a command line utility called ec in embedchain that inherits the template for fly.io platform and help you deploy the app. Follow the instructions to create a fly.io app using the template provided:
pip install embedchain
mkdir my-rag-app
ec create --template=fly.io
This will generate a directory structure like this:
├── Dockerfile
├── app.py
├── fly.toml
├── .env
├── .env.example
├── embedchain.json
└── requirements.txt
Feel free to edit the files as required.
Dockerfile: Defines the steps to setup the applicationapp.py: Contains API app codefly.toml: fly.io config file.env: Contains environment variables for production.env.example: Contains dummy environment variables (can ignore this file)embedchain.json: Contains embedchain specific configuration for deployment (you don't need to configure this)requirements.txt: Contains python dependencies for your applicationYou can run the app locally by simply doing:
pip install -r requirements.txt
ec dev
You can deploy to fly.io using the following command:
ec deploy
Once this step finished, it will provide you with the deployment endpoint where you can access the app live. It will look something like this (Swagger docs):
You can also check the logs, monitor app status etc on their dashboard by running command fly dashboard.
If you run into issues with deployment, please feel free to reach out to us via any of the following methods:
<Snippet file="get-help.mdx" />