Skip to content

chore(_example): run multiple docker executors configured from _example/.env#1617

Open
Scra3 wants to merge 1 commit into
chore/run-multiple-instancesfrom
chore/multiple-instance-scripts-from-env
Open

chore(_example): run multiple docker executors configured from _example/.env#1617
Scra3 wants to merge 1 commit into
chore/run-multiple-instancesfrom
chore/multiple-instance-scripts-from-env

Conversation

@Scra3
Copy link
Copy Markdown
Member

@Scra3 Scra3 commented Jun 2, 2026

What

Adds a one-command way to run the agent + the 2 docker executors (behind the nginx gateway on :3400), with all config coming from packages/_example/.env — nothing to edit in the executor example.

New scripts (in packages/_example):

  • start:with-executor:multiple-instance — agent + docker executors (reuses the pre-built image)
  • start:with-executor:multiple-instance:build — same, rebuilding the executor image

How

  • A small wrapper packages/_example/scripts/start-docker-executors.sh sources _example/.env, translates host-local URLs (localhost / 127.0.0.1 / *.development.forestadmin.com) so the containers can reach the host, waits for the agent, then delegates.
  • The executor example's executors / executors:build scripts stay config-agnostic (pure docker compose up). Run standalone from the executor example dir, they use that package's own env — not _example/.env.

Fixes to the existing compose

  • build.context ../..../../.. so the Dockerfile's COPY . . sees the repo root (was failing with lstat .../packages/packages).
  • Map *.development.forestadmin.com dev domains to the host via extra_hosts (they resolve to 127.0.0.1 on the host; inert for prod api.forestadmin.com), so containers can reach a local orchestrator.
  • Drop the separate .env.executors flow from the docs/header (config now lives only in _example/.env).

🤖 Generated with Claude Code

Note

Run multiple docker executors configured from _example/.env

  • Adds a start-docker-executors.sh script that sources packages/_example/.env, rewrites localhost/127.0.0.1 endpoints to host.docker.internal, and waits for the agent to be reachable before starting executors.
  • Adds start:with-executor:multiple-instance and start:with-executor:multiple-instance:build scripts to packages/_example/package.json that run the agent and docker executors concurrently via concurrently --kill-others.
  • Updates docker-compose.executors.yml to add extra_hosts entries mapping Forest local-dev domains to host-gateway, and changes the executor-1 build context from ../.. to ../../.. (repo root).
  • Risk: the broader Docker build context for executor-1 may include unintended files from the repo root in the image.

Macroscope summarized 47612a6.

…le/.env

Add start:with-executor:multiple-instance[:build] (agent + the 2 docker
executors behind the nginx gateway). All config comes from packages/_example/.env
— nothing to edit in the executor example: a small wrapper script sources it,
translates host-local URLs (localhost/127.0.0.1/dev domains) so containers reach
the host, waits for the agent, then delegates.

The executor example's `executors`/`executors:build` scripts stay config-agnostic
(pure `docker compose up`), so running them standalone uses that package's own env,
not _example/.env.

Also fix the build context (../.. -> ../../.. so the Dockerfile's COPY . . sees the
repo root) and map the *.development.forestadmin.com dev domains to the host so the
containers can reach a local orchestrator.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@qltysh
Copy link
Copy Markdown

qltysh Bot commented Jun 2, 2026

Qlty


Coverage Impact

This PR will not change total coverage.

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

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