Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ docs
*.swp
*~
.DS_Store
interview-app/node_modules
interview-app/apps.json
interview-app/data
interview-app/builds
interview-app/public/builds
interview-app/uploads
interview-app/certs
interview-app/action-log*.jsonl
interview-app/.session-state.json
interview-app/.conversation-backup.json
5 changes: 4 additions & 1 deletion .github/workflows/fly-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches: [main]
paths:
- 'fly.toml'
- 'Dockerfile.fly'
- '.dockerignore'
- 'interview-app/**'
- '.github/workflows/fly-deploy.yml'
workflow_dispatch:
Expand Down Expand Up @@ -42,4 +45,4 @@ jobs:
flyctl deploy \
--remote-only \
--app "${APP_NAME}" \
--config interview-app/fly.toml.example
--config fly.toml
21 changes: 21 additions & 0 deletions Dockerfile.fly
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:22-slim

WORKDIR /app

ENV NODE_ENV=production

COPY interview-app/package*.json ./
RUN npm ci --omit=dev && npm cache clean --force

COPY interview-app/ ./

RUN mkdir -p /data

ENV PORT=8080
ENV YAPPY_STORAGE_DIR=/data
ENV FORCE_HTTP=true
ENV AUTO_GENERATE_CERTS=false

EXPOSE 8080

CMD ["node", "server.js"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ Deploy docs: `docs/github-pages.md`
Distribution docs: `docs/distribution.md`
Fly API rollout docs: `docs/fly-api-rollout.md`
Fly CI deploy workflow: `.github/workflows/fly-deploy.yml`
Fly config: `fly.toml`
Family launch docs: `docs/family-launch.md`
Deploy queue docs: `docs/deploy-queue.md`
Legal/supervision docs: `docs/legal-supervision.md`
Expand Down
17 changes: 6 additions & 11 deletions docs/fly-api-rollout.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,15 @@ This is the path to move Yappybara from local-only to a hosted service parents c

## Repo artifacts added for hosting

- `interview-app/Dockerfile`
- `interview-app/fly.toml.example`
- `fly.toml` (repo root; used by Fly GitHub integration)
- `Dockerfile.fly` (repo root; builds `interview-app/`)
- `interview-app/Dockerfile` (subdir deploy option)
- `interview-app/fly.toml.example` (reference config)
- `interview-app/.dockerignore`
- `YAPPY_STORAGE_DIR` support in `interview-app/server.js`

## Day-1 hosted deploy

From repo root:

```bash
cd interview-app
cp fly.toml.example fly.toml
```

Create app + volume (example region `ord`):

```bash
Expand All @@ -53,7 +48,7 @@ fly secrets set ANTHROPIC_API_KEY=... \
Deploy:

```bash
fly deploy
fly deploy --config fly.toml
```

Smoke test:
Expand All @@ -69,7 +64,7 @@ This repo includes `.github/workflows/fly-deploy.yml`.
On every push to `main` that touches `interview-app/`, GitHub Actions runs:

```bash
flyctl deploy --remote-only --config interview-app/fly.toml.example
flyctl deploy --remote-only --config fly.toml
```

Configure in GitHub:
Expand Down
39 changes: 39 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
app = "yappybara-api"
primary_region = "ord"

[build]
dockerfile = "Dockerfile.fly"

[env]
PORT = "8080"
YAPPY_MODE = "claude"
YAPPY_BILLING_MODE = "api"
YAPPY_STORAGE_DIR = "/data"
YAPPY_DEPLOY_DOMAIN = "yappybara.dev"
YAPPY_DEPLOY_PRICE_USD = "9"
FORCE_HTTP = "true"
AUTO_GENERATE_CERTS = "false"

[http_service]
internal_port = 8080
force_https = true
auto_start_machines = true
auto_stop_machines = true
min_machines_running = 0
processes = ["app"]

[[http_service.checks]]
interval = "15s"
timeout = "5s"
grace_period = "20s"
method = "GET"
path = "/api/health"

[[vm]]
memory = "1gb"
cpu_kind = "shared"
cpus = 1

[[mounts]]
source = "yappybara_data"
destination = "/data"