Skip to content

feat(infra): keep self-hosted deploy state local - #124

Merged
flamboh merged 1 commit into
mainfrom
infra/self-hosted-local-state
Sep 29, 2026
Merged

flamboh merged 1 commit into
mainfrom
infra/self-hosted-local-state

Conversation

@flamboh

@flamboh flamboh commented Sep 29, 2026

Copy link
Copy Markdown
Owner

The self-hosted deploy only creates Docker resources on the target server, but it kept Alchemy's deploy state in the Cloudflare state store, so it needed Cloudflare credentials. It now uses Alchemy's local state (.alchemy/ in the checkout, already gitignored). The Cloudflare stack is unchanged.

Decision

State lives in the checkout you deploy from. Deploy, redeploy, and destroy from that same checkout; a different clone doesn't know the container exists (a second deploy would collide on the container name, and destroy would find nothing). The user docs say this in one line and no longer list Cloudflare credentials as a prerequisite.

Try it

With no CLOUDFLARE_* variables set:

export ATLANTIS_SELF_HOSTED_DOCKER_HOST=ssh://user@server.example.com
export ATLANTIS_SELF_HOSTED_DATA_DIR=/path/to/data   # contains <dataset-id>/netflow.sqlite
export ATLANTIS_SELF_HOSTED_DATA_USER=$(ssh user@server.example.com 'echo $(id -u):$(id -g)')
bun run deploy:self-hosted --stage test --yes

Expected: Done: 3 succeeded, .alchemy/state appears in the checkout, the container turns healthy, and curl 127.0.0.1:8080/api/datasets on the server lists the datasets. bun run destroy:self-hosted --stage test from the same checkout removes it.

Verification

  • Deployed this branch to a lab server with no Cloudflare credentials in the environment, using a partial product database as sample data. The container was healthy, /api/datasets returned the dataset, and the dashboard rendered charts over the sample range.
  • bun run format, bun run lint, bun run typecheck pass.

@flamboh
flamboh merged commit a03b98c into main Sep 29, 2026
3 checks passed
@flamboh
flamboh deleted the infra/self-hosted-local-state branch September 29, 2026 08:27
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.

1 participant