Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@steipete
Copy link
Contributor

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 setup

Usage

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!

- 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
@cursor
Copy link

cursor bot commented Jan 24, 2026

PR Summary

Adds Fly.io deployment support with configuration and user docs.

  • New fly.toml defining app clawdbot, region lhr, http_service on port 3000 with HTTPS, single shared-cpu-1x VM (512MB), env vars, and a persistent volume mounted at /data
  • New docs/platforms/fly.md with quick start commands, secrets setup, access/logs guidance, and deployment notes

Written by Cursor Bugbot for commit 8bad569. This will update automatically on new commits. Configure here.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines +7 to +8
[build]
dockerfile = "Dockerfile"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +26 to +28
[mounts]
source = "clawdbot_data"
destination = "/data"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link

@cursor cursor bot left a 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
Copy link

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.

Fix in Cursor Fix in Web

primary_region = "lhr" # London

[build]
dockerfile = "Dockerfile"
Copy link

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.

Fix in Cursor Fix in Web


[mounts]
source = "clawdbot_data"
destination = "/data"
Copy link

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.

Fix in Cursor Fix in Web

@dguido
Copy link
Contributor

dguido commented Jan 25, 2026

Hey! We've been running this setup and learned a few things that might help others:

Data Persistence

The default setup doesn't persist ~/.clawdbot across deploys. We added a docker-entrypoint.sh that symlinks it to the volume:

#!/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.

@steipete
Copy link
Contributor Author

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!

@steipete steipete closed this Jan 25, 2026
@shakkernerd shakkernerd deleted the feat/fly-io branch January 26, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants