-
Notifications
You must be signed in to change notification settings - Fork 15.7k
feat: add Fly.io deployment support #1570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add fly.toml configuration for Fly.io deployment - Add docs/platforms/fly.md with deployment guide - Uses London (lhr) region by default - Includes persistent volume for data storage
PR SummaryAdds Fly.io deployment support with configuration and user docs.
Written by Cursor Bugbot for commit 8bad569. This will update automatically on new commits. Configure here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8bad569ca9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| [build] | ||
| dockerfile = "Dockerfile" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Configure Fly to run the gateway process
Fly will use the Dockerfile’s default CMD when no cmd/processes are specified in fly.toml. The Dockerfile’s CMD is node dist/index.js (CLI only), which exits without running gateway unless args are provided (note that docker-compose.yml has to pass gateway explicitly). As written, a fly deploy will start a machine that exits immediately, leaving no listener. Add an explicit Fly process/command to run node dist/index.js gateway ….
Useful? React with 👍 / 👎.
| CLAWDBOT_PREFER_PNPM = "1" | ||
|
|
||
| [http_service] | ||
| internal_port = 3000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align Fly internal_port with gateway port
The gateway listens on port 18789 by default (DEFAULT_GATEWAY_PORT in src/config/paths.ts), and this config does not set CLAWDBOT_GATEWAY_PORT or --port. With internal_port = 3000, Fly will route to a port the gateway never binds to, so health checks and fly open will fail even if the gateway is running. Set internal_port to 18789 or set CLAWDBOT_GATEWAY_PORT=3000 and pass --port 3000.
Useful? React with 👍 / 👎.
| [mounts] | ||
| source = "clawdbot_data" | ||
| destination = "/data" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Persist state to the mounted Fly volume
The volume is mounted at /data, but Clawdbot stores state under ~/.clawdbot by default (resolveStateDir in src/config/paths.ts). Without setting CLAWDBOT_STATE_DIR=/data (or HOME=/data), the gateway will write sessions, credentials, and logs to the container’s ephemeral filesystem and lose them on restarts, despite the volume. Wire the state dir to the mounted path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| CLAWDBOT_PREFER_PNPM = "1" | ||
|
|
||
| [http_service] | ||
| internal_port = 3000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong internal port causes deployment failure
High Severity
The internal_port = 3000 is incorrect. The Clawdbot gateway listens on port 18789, as shown in docker-compose.yml and the project documentation. Fly.io will attempt to route traffic and perform health checks on port 3000, but the gateway won't be listening there, causing the deployment to be unreachable or fail health checks.
| primary_region = "lhr" # London | ||
|
|
||
| [build] | ||
| dockerfile = "Dockerfile" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing gateway command prevents container from starting
High Severity
The fly.toml references the Dockerfile but doesn't override its CMD to start the gateway. The Dockerfile's CMD is ["node", "dist/index.js"], which is a CLI requiring subcommands. Without a [processes] section specifying the gateway command (like docker-compose.yml does), the container will show CLI help and exit immediately.
|
|
||
| [mounts] | ||
| source = "clawdbot_data" | ||
| destination = "/data" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Volume mount path mismatch causes data loss
High Severity
The volume is mounted at /data, but the application stores persistent data at ~/.clawdbot/. Without the HOME environment variable set (like docker-compose.yml does with HOME: /home/node), data will be written to /root/.clawdbot/ which is not on the persistent volume. Configuration, sessions, credentials, and other data will be lost on container restart.
|
Hey! We've been running this setup and learned a few things that might help others: Data Persistence The default setup doesn't persist #!/bin/sh
set -e
if [ -d "/data" ]; then
mkdir -p /data/.clawdbot
rm -rf /root/.clawdbot
ln -sf /data/.clawdbot /root/.clawdbot
fi
exec "$@"Helpful env vars [env]
CLAWDBOT_STATE_DIR = "/data"
NODE_OPTIONS = "--max-old-space-size=1536"Signal Support (optional)If you need Signal, add Java + signal-cli via build arg and bump memory to 2GB. The entrypoint can pre-start the daemon to avoid cold-start timeouts. Happy to share details if anyone needs this. |
|
Closing as duplicate/conflicting with main; Fly docs + config already exist. Applied the learnings (port alignment, state dir persistence, troubleshooting) directly on main in 6cc1f5a. Thanks! |
Adds Fly.io deployment configuration and documentation.
Changes
fly.toml- Fly.io app configuration (London region, persistent volume, production settings)docs/platforms/fly.md- Deployment guide with quick start and secrets setupUsage
fly apps create clawdbot fly volumes create clawdbot_data --size 1 --region lhr fly secrets set ANTHROPIC_API_KEY=... fly deploy🦞 Flawd is ready to fly!