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.
Summary
On
main(verified at003524b), theegress_gatewaycontainer exits immediately after build:Cause
service/src/secure-startup.tsimports from the shared code package:That import arrived with the bridge work (
da8775f).service/Dockerfilecopies the package into the image so the relative path resolves:service/Dockerfile.egress-gatewaycopies onlyservice/srcandshared, in both itsproductionanddevelopmentstages, so the module is absent at runtime:Because
secure-startup.tsis shared by every service that boots throughservice/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
COPYthe sibling Dockerfile already has, to both stages ofservice/Dockerfile.egress-gateway: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.