Skip to content

egress_gateway image is missing packages/code, which shared secure-startup.ts imports #117

Description

@danny-avila

Summary

On main (verified at 003524b), the egress_gateway container exits immediately after build:

error: Cannot find module '../../packages/code/src/protocol' from '/app/src/secure-startup.ts'

Bun v1.3.14 (Linux x64 baseline)

Cause

service/src/secure-startup.ts imports from the shared code package:

import { isValidBridgeWorkerId } from '../../packages/code/src/protocol';

That import arrived with the bridge work (da8775f). service/Dockerfile copies the package into the image so the relative path resolves:

COPY service/src ./src
COPY service/scripts ./scripts
COPY packages/code/src /packages/code/src

service/Dockerfile.egress-gateway copies only service/src and shared, in both its production and development stages, so the module is absent at runtime:

COPY --from=install /temp/prod/node_modules ./node_modules
COPY service/src ./src
COPY shared /shared

Because secure-startup.ts is shared by every service that boots through service/src/lifecycle.ts, the gateway pulls in an import its image does not ship.

Reproduction

docker compose build egress_gateway
docker compose up -d egress_gateway
docker logs egress_gateway   # Cannot find module '../../packages/code/src/protocol'

Suggested fix

Add the same COPY the sibling Dockerfile already has, to both stages of service/Dockerfile.egress-gateway:

COPY service/src ./src
COPY packages/code/src /packages/code/src

Verified: with that one line added the gateway builds and starts normally (Egress gateway listening on port 3190, healthy).

Worth a quick audit of the other per-service Dockerfiles for the same omission, since the trigger is any image whose entrypoint reaches secure-startup.ts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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