Skip to content

Commit e63c906

Browse files
authored
Merge pull request #18 from second-state/fly.io
Add Fly.io deployment config and update Dockerfile
2 parents bf2ae1a + c94a261 commit e63c906

File tree

3 files changed

+79
-1
lines changed

3 files changed

+79
-1
lines changed

docker/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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`

docker/fly.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# fly.toml app configuration file generated for echokit-server on 2025-11-25T18:57:15+08:00
2+
#
3+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4+
#
5+
6+
app = 'echokit-server'
7+
8+
[build]
9+
image = 'registry.fly.io/echokit-server:latest-server-vad'
10+
11+
[http_service]
12+
internal_port = 8080
13+
force_https = false
14+
auto_stop_machines = 'stop'
15+
auto_start_machines = true
16+
min_machines_running = 0
17+
processes = ['app']
18+
19+
[[vm]]
20+
memory = '1gb'
21+
cpu_kind = 'shared'
22+
cpus = 1

docker/server-vad/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ FROM debian:bookworm-slim
55
WORKDIR /app
66

77
ARG TARGETPLATFORM
8-
ARG ECHOKIT_VERSION=0.1.0
8+
ARG ECHOKIT_VERSION=0.2.2
99
ARG VAD_VERSION=0.1.0
1010

1111
RUN set -eux; \
@@ -115,4 +115,6 @@ EOF
115115

116116
ENV RUST_LOG=info
117117

118+
EXPOSE 8080
119+
118120
CMD ["/usr/local/bin/start_servers.sh"]

0 commit comments

Comments
 (0)