|
| 1 | +This doc guides you through building and deploying the echokit_server container to Fly.io. |
| 2 | + |
| 3 | +## Prerequisites |
| 4 | +- flyctl installed: see https://github.com/superfly/flyctl |
| 5 | +- Docker installed and running locally |
| 6 | +- A unique Fly app name (Fly app names are globally unique) |
| 7 | + |
| 8 | +## 1) Create the Fly app |
| 9 | +```bash |
| 10 | +fly app create --name echokit-server-[something-unique] |
| 11 | +``` |
| 12 | + |
| 13 | +## 2) Build the Docker image |
| 14 | +From the server-vad directory, ensure `config.toml` is valid, then build: |
| 15 | +```bash |
| 16 | +cd server-vad |
| 17 | +docker build -t registry.fly.io/[your_app_name]:tag . |
| 18 | +``` |
| 19 | + |
| 20 | +## 3) Push the image to Fly |
| 21 | +Authenticate to the Fly registry and push the image: |
| 22 | +```bash |
| 23 | +fly auth docker |
| 24 | +docker push registry.fly.io/[your_app_name]:tag |
| 25 | +``` |
| 26 | + |
| 27 | +## 4) Configure Fly to use the image |
| 28 | +Update `fly.toml` to point to `registry.fly.io/[your_app_name]:tag`. |
| 29 | + |
| 30 | +## 5) Deploy |
| 31 | +From the `docker` directory: |
| 32 | +```bash |
| 33 | +fly deploy |
| 34 | +``` |
| 35 | + |
| 36 | +## Managing machines |
| 37 | +- Deploy creates two machines in the same region by default. Remove one if you only need a single instance: |
| 38 | + ```bash |
| 39 | + fly machine list # get machine IDs |
| 40 | + fly machine destroy [id] # remove one |
| 41 | + ``` |
| 42 | +- To run in additional regions, clone a machine: |
| 43 | + ```bash |
| 44 | + fly platform regions # list region codes |
| 45 | + fly machine clone [id] --region dfw # example clone into DFW |
| 46 | + ``` |
| 47 | + |
| 48 | +## Quick checklist |
| 49 | +- [ ] flyctl installed and authenticated |
| 50 | +- [ ] Unique app name chosen |
| 51 | +- [ ] `config.toml` validated in `server-vad` |
| 52 | +- [ ] Image built and pushed to Fly registry |
| 53 | +- [ ] `fly.toml` updated with the pushed image tag |
| 54 | +- [ ] App deployed with `fly deploy` |
0 commit comments