Skip to content

feat: gateway-in-container mode — run nemesis8 serve inside a container #23

@kordless

Description

@kordless

Context

Currently nemesis8 serve runs on the host and spawns one-shot containers per request. A gateway-in-container mode would run the gateway process itself inside a container, binding the Docker socket through (-v /var/run/docker.sock:/var/run/docker.sock or Podman equivalent) so it can still spawn sibling containers.

Use cases

  • Fully containerized deployment (no host Rust binary needed at runtime)
  • Running nemesis8 as a service inside a Docker Compose stack or Kubernetes pod
  • Isolated gateway with controlled socket access

What changes

  1. nemesis8 serve --containerized — wraps the gateway in a docker run call with socket bind-mount and port mapping, then detaches
  2. GATEWAY_URL for spawned sibling containers: use the gateway's container name or Docker network IP (not host.docker.internal), since gateway and agents are on the same Docker bridge
  3. Single-instance check: current check pings localhost:{port} — needs to also check for a running container with a gateway label via Docker API

Dependency

Builds on #19 and #21.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions