Skip to content

feat: add sandbox worker support with multi-arch Docker builds#6

Merged
andersonleal merged 4 commits intomainfrom
feat/worker-sandbox
Apr 6, 2026
Merged

feat: add sandbox worker support with multi-arch Docker builds#6
andersonleal merged 4 commits intomainfrom
feat/worker-sandbox

Conversation

@andersonleal
Copy link
Copy Markdown
Collaborator

@andersonleal andersonleal commented Apr 3, 2026

Summary

  • Multi-architecture Dockerfile for the image-resize worker — supports both amd64 and arm64 via cross-compilation with platform-specific linkers
  • New worker configuration format — adds iii.worker.yaml (defines the worker sandbox runtime: language, entry, resources, scripts) and iii.workers.yaml (declares external worker images with env/resource constraints), replacing the previous iii.toml approach
  • Example project updates — switches runtime from bun to node --import tsx, adds tsx dev dependency, updates package scope to @iii, and comments out the old inline worker config in config.yaml

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Configuration change

Checklist

  • Code follows existing style guidelines
  • Changes have been self-reviewed
  • Dockerfile supports multi-arch builds (amd64/arm64)
  • Worker manifest is auto-generated at build time via cargo run --release -- --manifest

Additional Context

This PR introduces the foundational configuration for running workers as sandboxed containers. The iii.worker.yaml defines how the engine should provision a worker sandbox (language runtime, entry point, resource limits, install/start scripts), while iii.workers.yaml declares pre-built worker images that can be pulled and launched by the engine. The Dockerfile uses a two-stage build with cross-compilation to produce minimal Debian-based images for both x86_64 and ARM64 targets.

Summary by CodeRabbit

  • New Features

    • Added a multi-stage cross-platform container build and packaged runtime image.
    • Added runnable example manifests and a demo worker setup with env defaults and startup scripts.
  • Chores

    • Updated example project tooling and package name; switched dev startup tooling.
    • Added Docker ignore rules to exclude repo/docs artifacts.
    • Example worker now logs a startup message on launch.

… and update example configurations

Updated the Dockerfile to support multi-architecture builds by adding necessary cross-compilation tools and adjusting the build process. Modified example configuration files to include new environment variables and updated the package.json to switch the development script from Bun to npm, ensuring compatibility with TypeScript. Added logging for custom environment variables in the TypeScript worker.

feat(example-typescript): replace Bun with npm in image resize demo worker setup

Switches to npm for dependency and script management. Updates the package manager and runtime scripts, removes Bun-specific setup, and adds a new lockfile.

refactor(example-rust): remove Rust image resize demo worker

fix(example-python): use asyncio.run with Event for keepalive (Python 3.14 compat)

fix(example-python): keep process alive with event loop to receive invocations

fix(example-python): use InitOptions instead of raw dict for register_worker

feat(example-python): add Python image resize demo worker

Mirrors the TypeScript example with health and thumbnail endpoints.
Uses iii-sdk Python package to connect to the engine and invoke
image_resize::resize via SDK channels.

fix(image-resize): skip config.yaml load when file doesn't exist

docs: add Podman runtime implementation plan

6-task plan covering PodmanAdapter creation, Docker/Sandbox removal,
microsandbox delegation update, managed.rs simplification, CLI cleanup,
and full build verification.

docs: add Podman runtime design spec

Replace Docker with Podman as sole container runtime. Remove SandboxAdapter
and --isolation flag. Dev mode stays microsandbox-only. Managed workers use
Podman with auto podman-machine management on macOS.

refactor: all manifests use iii: v1 (no v2 version needed)

fix(example-python): install iii-sdk directly instead of building from pyproject.toml

pip install . triggers a full build that spawns subprocesses hitting the
microsandbox 1024 fd limit. Install the SDK dep directly and use PYTHONPATH
to make the local module importable.

fix(example-python): use non-editable pip install (editable hits fd limit in msb)

fix(example-python): use system pip directly, skip venv (ensurepip broken in msb)

fix(example-python): remove sudo from setup, fix invalid pyproject.toml scripts

- Drop setup script: msb python image has Python 3.14, venv, and pip
- Remove invalid [project.scripts] entry that caused pip install failure
  (must be entrypoint reference, not shell command)

fix(example): remove apt-get from bun setup, microsandbox node image has curl

feat: upgrade all example manifests to iii.worker.yaml v2 format

- TypeScript/Bun, Python, Rust examples now use v2 schema
- Plain MB for memory instead of K8s-style (512Mi → 512)
- scripts section replaces dependencies section
- III_URL/III_ENGINE_URL removed from env (auto-injected by engine)

docs: add microsandbox runtime design spec

Microsandbox as primary strong-isolation runtime, Docker Sandbox as
fallback. iii.worker.yaml v2 format with structured runtime declarations
and auto-detection. Solves WebSocket proxy issue with Docker Sandbox.

docs(example-rust): document sandbox limitation on Apple Silicon (rustc SIGILL)

fix(example-rust): use debug build in sandbox to avoid SIGILL on ARM VM

fix(example-rust): cargo clean before build to avoid cross-platform target corruption

fix(examples): use sudo for apt-get in sandbox setup

fix(example-rust): install build-essential for cc linker in sandbox

fix(example-rust): use iii-sdk from crates.io instead of local path

Path deps aren't visible inside the sandbox since only the project
workspace directory is synced.

fix(example-python): use venv for pip install inside sandbox VM

feat(examples): add Python and Rust image-resize demo workers

Both mirror the Node.js example — health check + thumbnail endpoints
connecting to image_resize::resize via channels. Each includes
iii.worker.yaml for sandbox dev with `iii worker dev`.

feat(example): add iii.worker.yaml for sandbox dev environment

Declares bun runtime setup, install, and run commands so
'iii worker dev' knows how to build the sandbox VM.

docs: add Docker Sandbox runtime design spec

Replaces Firecracker with Docker Sandboxes for strong isolation.
microVM isolation on Mac/Windows without KVM. Two runtimes (docker,
sandbox), two deployment modes (per-worker sandbox, engine-in-sandbox).

refactor(launcher): remove iii-launcher module and associated files

This commit deletes the iii-launcher module, including its Cargo.toml, Cargo.lock, and source files. The removal streamlines the project structure as the launcher functionality is no longer needed.

feat(launcher): add health check loop with exponential backoff restarts

feat(launcher): return restart info in status response

feat(launcher): add configurable stop timeout to Docker adapter

SIGTERM + grace period before SIGKILL: 30s for explicit stops,
10s for pre-start cleanup.

feat(launcher): add restart tracking fields to ManagedWorker state

docs: add Phase 2A runtime hardening implementation plan

6 tasks: state enrichment, Docker stop timeout, resource enforcement,
health check loop, enriched status output, SDK graceful shutdown drain.

docs: add Phase 2A runtime hardening design spec

Resource enforcement from manifests, health check loop with exponential
backoff restarts, graceful shutdown via Docker SIGTERM + SDK drain.

feat(launcher): add iii-launcher worker with DockerAdapter

RuntimeAdapter trait, Docker CLI implementation, launcher state
persistence, and 5 function handlers (pull, start, stop, status, logs).

feat(image-resize): add Dockerfile with embedded manifest, prepare SDK manifest integration

feat(ci): add OCI build workflow, registry v2 format, switch release from binary to OCI

feat(image-resize): emit iii worker manifest in YAML format

docs: add Phase 1 implementation plan for iii worker abstraction layer

13 tasks covering manifest types, protocol extensions, manifest-driven
readiness, SDK support, OCI build, launcher worker with Docker adapter,
CLI commands, registry v2, CI/CD workflow, and E2E verification.

docs: add iii worker abstraction layer design spec

Design for decoupling worker artifacts and contracts from runtime
substrates. OCI images as canonical packaging, dedicated launcher
sidecar, manifest-driven readiness, and backward-compatible protocol
extensions.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8e0806c7-e448-42cd-a883-34923628a3c0

📥 Commits

Reviewing files that changed from the base of the PR and between 6927b04 and 6b0675c.

📒 Files selected for processing (1)
  • image-resize/example/config.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • image-resize/example/config.yaml

📝 Walkthrough

Walkthrough

Adds containerization for the image-resize worker (multi-arch Dockerfile and .dockerignore), replaces in-repo example worker configs with container-based manifests, updates the example TypeScript demo and tooling, and adjusts a manifest test to use the crate package version constant.

Changes

Cohort / File(s) Summary
Docker build
image-resize/.dockerignore, image-resize/Dockerfile
Adds a multi-stage Dockerfile with cross-compilation logic for amd64/arm64, copies built binary and generated worker YAML into a slim Debian runtime image; adds .dockerignore to exclude build/docs/git artifacts.
Example configs removed/updated
image-resize/example/config.yaml, image-resize/example/iii.toml
Reworks example config: removes top-level port and replaces class-based worker/module entries with name-based container/stream configurations; removes pinned workers section from iii.toml.
Container-based example manifests
image-resize/example/iii.workers.yaml, image-resize/example/iii.worker.yaml
Adds iii.workers.yaml referencing a container image with env and resource limits; adds iii.worker.yaml demo manifest (TypeScript runtime, env var, resource limits, install/start scripts).
Example app changes
image-resize/example/package.json, image-resize/example/src/iii.ts
Renames package to @iii/image-resize-demo, switches dev runtime to node --import tsx and adds tsx devDependency; adds console.info startup log emitting MY_CUSTOM_VAR.
Test update
image-resize/src/manifest.rs
Updates test assertion to compare manifest version against CARGO_PKG_VERSION instead of a hard-coded "0.1.0".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped through Dockerfiles and YAML streams,
Built tiny binaries and tweaked the dev dreams.
A TypeScript hello, a manifest true,
Cross-arch bits and a log that grew—
I nibble changes, then skip to new greens.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add sandbox worker support with multi-arch Docker builds' accurately reflects the main changes: introduction of sandbox worker configuration (iii.worker.yaml, iii.workers.yaml) and a multi-architecture Dockerfile supporting amd64/arm64 builds.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/worker-sandbox

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (3)
image-resize/Dockerfile (1)

6-13: Use --no-install-recommends in both apt installs.

These stages only need the named packages; recommended packages just add size and attack surface.

💡 Proposed fix
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y --no-install-recommends \
     pkg-config \
     libssl-dev \
     gcc-x86-64-linux-gnu \
     gcc-aarch64-linux-gnu \
     libc6-dev-amd64-cross \
     libc6-dev-arm64-cross \
     && rm -rf /var/lib/apt/lists/*
@@
-RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
+RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/*

Also applies to: 43-43

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@image-resize/Dockerfile` around lines 6 - 13, The apt installs in the
Dockerfile RUN steps currently use apt-get install -y without suppressing
recommends; update both RUN commands (the apt-get install lines that install
pkg-config, libssl-dev, gcc-x86-64-linux-gnu, gcc-aarch64-linux-gnu,
libc6-dev-amd64-cross, libc6-dev-arm64-cross and the other install at line ~43)
to include --no-install-recommends (i.e., apt-get install -y
--no-install-recommends ...) so only the named packages are installed and extra
recommended packages are avoided, keeping the rest of the command structure
(apt-get update && ... && rm -rf /var/lib/apt/lists/*) intact.
image-resize/.dockerignore (1)

1-6: Exclude image-resize/example/ from this build context too.

image-resize/Dockerfile never copies anything from image-resize/example/, so sending that directory to buildx just adds upload time and cache noise.

💡 Proposed fix
 target/
 .git/
 *.md
 docs/
 iii-launcher/
 .github/
+example/
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@image-resize/.dockerignore` around lines 1 - 6, Add the build-context
exclusion for the example directory by updating the .dockerignore to include a
rule for the example/ folder so it is not sent to the Docker build context;
specifically, add a line excluding "example/" (and "example/**" if you prefer
recursive coverage) to the existing .dockerignore entries so the Dockerfile
won't cause the example files to be uploaded during build.
image-resize/example/iii.workers.yaml (1)

3-3: Pin a versioned image here instead of latest.

latest makes this example non-reproducible and can silently change the worker bits between runs. A release tag or digest is safer now that multi-arch images are being published.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@image-resize/example/iii.workers.yaml` at line 3, Replace the
non-reproducible image reference under the image key in iii.workers.yaml
(currently "docker.io/andersonofl/image-resize:latest") with a specific release
tag or a digest (for example a semver tag like v1.2.3 or a sha256 digest) so the
worker image is immutable and reproducible; update the image value to the chosen
tag/digest and commit the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@image-resize/Dockerfile`:
- Around line 22-39: The manifest generation is using the host compile-time
TARGET (env!("TARGET")) because cargo run --release -- --manifest is invoked
before TARGET_TRIPLE is computed; resolve TARGET_TRIPLE from TARGETARCH first
(the same case block that sets TARGET_TRIPLE and the cargo linker env vars) and
then invoke the manifest generation with that target (pass the computed
TARGET_TRIPLE into the manifest step—e.g. export or pass as an argument to the
cargo run invocation that generates the manifest) so
image-resize/src/manifest.rs observes the intended target rather than the
builder host.
- Around line 48-51: The Dockerfile hard-codes the --url flag so the ENV
III_ENGINE_URL has no effect; either update the Clap argument in
image-resize/src/main.rs to read from the environment (e.g., add env =
"III_ENGINE_URL" to the struct field or use Arg::env("III_ENGINE_URL") for the
URL option) so the binary picks up III_ENGINE_URL, or change the Dockerfile’s
ENTRYPOINT/CMD to perform shell expansion of the env var (e.g., emit the --url
value from ${III_ENGINE_URL}) so the runtime URL comes from the environment.
- Around line 41-51: The final Dockerfile image runs as root; create a non-root
runtime user and switch to it before ENTRYPOINT/CMD to reduce privileges: add a
user (e.g., iii or workeruser) in the final stage, chown the copied /worker
binary and /iii/worker.yaml to that user (ensure the COPY from=builder preserves
ownership or perform chown), and add a USER instruction so ENTRYPOINT
["/worker"] and CMD remain unchanged but run unprivileged; also ensure the
binary is executable by that user and any required runtime dirs have appropriate
permissions.

In `@image-resize/example/config.yaml`:
- Around line 1-6: The commented example in config.yaml uses the old list-style
"workers" block with "config" (e.g., workers: - name: image-resize / config:)
which no longer matches the new config shape; update the snippet to follow the
new structure used in iii.workers.yaml (e.g., workers.image-resize.env) and
expose the environment variables (III_ENGINE_URL, III_API_URL) under
workers.image-resize.env so that the example aligns with the new format and
users copying it get the correct keys.

---

Nitpick comments:
In `@image-resize/.dockerignore`:
- Around line 1-6: Add the build-context exclusion for the example directory by
updating the .dockerignore to include a rule for the example/ folder so it is
not sent to the Docker build context; specifically, add a line excluding
"example/" (and "example/**" if you prefer recursive coverage) to the existing
.dockerignore entries so the Dockerfile won't cause the example files to be
uploaded during build.

In `@image-resize/Dockerfile`:
- Around line 6-13: The apt installs in the Dockerfile RUN steps currently use
apt-get install -y without suppressing recommends; update both RUN commands (the
apt-get install lines that install pkg-config, libssl-dev, gcc-x86-64-linux-gnu,
gcc-aarch64-linux-gnu, libc6-dev-amd64-cross, libc6-dev-arm64-cross and the
other install at line ~43) to include --no-install-recommends (i.e., apt-get
install -y --no-install-recommends ...) so only the named packages are installed
and extra recommended packages are avoided, keeping the rest of the command
structure (apt-get update && ... && rm -rf /var/lib/apt/lists/*) intact.

In `@image-resize/example/iii.workers.yaml`:
- Line 3: Replace the non-reproducible image reference under the image key in
iii.workers.yaml (currently "docker.io/andersonofl/image-resize:latest") with a
specific release tag or a digest (for example a semver tag like v1.2.3 or a
sha256 digest) so the worker image is immutable and reproducible; update the
image value to the chosen tag/digest and commit the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6bfa68be-713e-4d59-aeef-2db2501cf5ae

📥 Commits

Reviewing files that changed from the base of the PR and between 2c8376d and bb169e8.

⛔ Files ignored due to path filters (1)
  • image-resize/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • image-resize/.dockerignore
  • image-resize/Dockerfile
  • image-resize/example/config.yaml
  • image-resize/example/iii.toml
  • image-resize/example/iii.worker.yaml
  • image-resize/example/iii.workers.yaml
  • image-resize/example/package.json
  • image-resize/example/src/iii.ts
💤 Files with no reviewable changes (1)
  • image-resize/example/iii.toml

Comment on lines +22 to +39
RUN cargo run --release -- --manifest > /build/worker.yaml

RUN case "${TARGETARCH}" in \
amd64) \
TARGET_TRIPLE="x86_64-unknown-linux-gnu"; \
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc; \
;; \
arm64) \
TARGET_TRIPLE="aarch64-unknown-linux-gnu"; \
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc; \
;; \
*) \
echo "Unsupported TARGETARCH=${TARGETARCH}" >&2; \
exit 1; \
;; \
esac && \
cargo build --release --target "${TARGET_TRIPLE}" && \
cp "target/${TARGET_TRIPLE}/release/image-resize" /worker
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

The generated manifest will advertise the build platform, not the target platform.

Line 22 runs cargo run --release -- --manifest before TARGETARCH is resolved, and image-resize/src/manifest.rs derives supported_targets from env!("TARGET"). An amd64 builder producing an arm64 image will still copy a manifest that says x86_64-unknown-linux-gnu.

Resolve TARGET_TRIPLE first and pass that into manifest generation instead of relying on the host build target.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@image-resize/Dockerfile` around lines 22 - 39, The manifest generation is
using the host compile-time TARGET (env!("TARGET")) because cargo run --release
-- --manifest is invoked before TARGET_TRIPLE is computed; resolve TARGET_TRIPLE
from TARGETARCH first (the same case block that sets TARGET_TRIPLE and the cargo
linker env vars) and then invoke the manifest generation with that target (pass
the computed TARGET_TRIPLE into the manifest step—e.g. export or pass as an
argument to the cargo run invocation that generates the manifest) so
image-resize/src/manifest.rs observes the intended target rather than the
builder host.

Comment on lines +41 to +51
FROM debian:bookworm-slim

RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*

COPY --from=builder /worker /worker
COPY --from=builder /build/worker.yaml /iii/worker.yaml

ENV III_ENGINE_URL=ws://host.containers.internal:49134

ENTRYPOINT ["/worker"]
CMD ["--url", "ws://host.containers.internal:49134"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Run the final image as a non-root user.

The runtime stage never drops root. For a sandbox worker, that's an unnecessary privilege boundary loss.

💡 Proposed fix
 FROM debian:bookworm-slim
 
 RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
+RUN useradd --system --uid 10001 --create-home iii \
+    && mkdir -p /iii \
+    && chown iii:iii /iii
 
-COPY --from=builder /worker /worker
-COPY --from=builder /build/worker.yaml /iii/worker.yaml
+COPY --from=builder --chown=iii:iii /worker /worker
+COPY --from=builder --chown=iii:iii /build/worker.yaml /iii/worker.yaml
 
 ENV III_ENGINE_URL=ws://host.containers.internal:49134
 
+USER iii
 ENTRYPOINT ["/worker"]
 CMD ["--url", "ws://host.containers.internal:49134"]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=builder /worker /worker
COPY --from=builder /build/worker.yaml /iii/worker.yaml
ENV III_ENGINE_URL=ws://host.containers.internal:49134
ENTRYPOINT ["/worker"]
CMD ["--url", "ws://host.containers.internal:49134"]
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
RUN useradd --system --uid 10001 --create-home iii \
&& mkdir -p /iii \
&& chown iii:iii /iii
COPY --from=builder --chown=iii:iii /worker /worker
COPY --from=builder --chown=iii:iii /build/worker.yaml /iii/worker.yaml
ENV III_ENGINE_URL=ws://host.containers.internal:49134
USER iii
ENTRYPOINT ["/worker"]
CMD ["--url", "ws://host.containers.internal:49134"]
🧰 Tools
🪛 Trivy (0.69.3)

[error] 43-43: 'apt-get' missing '--no-install-recommends'

'--no-install-recommends' flag is missed: 'apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*'

Rule: DS-0029

Learn more

(IaC/Dockerfile)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@image-resize/Dockerfile` around lines 41 - 51, The final Dockerfile image
runs as root; create a non-root runtime user and switch to it before
ENTRYPOINT/CMD to reduce privileges: add a user (e.g., iii or workeruser) in the
final stage, chown the copied /worker binary and /iii/worker.yaml to that user
(ensure the COPY from=builder preserves ownership or perform chown), and add a
USER instruction so ENTRYPOINT ["/worker"] and CMD remain unchanged but run
unprivileged; also ensure the binary is executable by that user and any required
runtime dirs have appropriate permissions.

Comment on lines +48 to +51
ENV III_ENGINE_URL=ws://host.containers.internal:49134

ENTRYPOINT ["/worker"]
CMD ["--url", "ws://host.containers.internal:49134"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

III_ENGINE_URL cannot actually reconfigure this image.

image-resize/src/main.rs only consumes --url, and Line 51 hard-codes that flag in CMD. Setting III_ENGINE_URL from image-resize/example/iii.workers.yaml or the container environment has no effect.

Either bind the Clap arg to env = "III_ENGINE_URL" or expand the env in the entrypoint.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@image-resize/Dockerfile` around lines 48 - 51, The Dockerfile hard-codes the
--url flag so the ENV III_ENGINE_URL has no effect; either update the Clap
argument in image-resize/src/main.rs to read from the environment (e.g., add env
= "III_ENGINE_URL" to the struct field or use Arg::env("III_ENGINE_URL") for the
URL option) so the binary picks up III_ENGINE_URL, or change the Dockerfile’s
ENTRYPOINT/CMD to perform shell expansion of the env var (e.g., emit the --url
value from ${III_ENGINE_URL}) so the runtime URL comes from the environment.

…and enhance CORS options

- Introduced new worker definitions for iii-stream and iii-http with specific configurations.
- Enhanced CORS settings to include additional allowed methods and clarified allowed origins.
- Removed deprecated module definitions for a cleaner configuration structure.
@andersonleal andersonleal merged commit 062629a into main Apr 6, 2026
2 checks passed
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.

2 participants