Worklog for task "Fix network routing of child projects via Traefik"
2026-09-27 — Traffic proxying in DinD via Traefik
Routing to a child project run via Docker Compose inside DinD has been tested and brought to a working state.
Result
Working chain: external Traefik → DinD:2015 → socat → internal Traefik:80 → app:3000. The nextjs-test project is successfully accessible at http://nextjs-test.localhost:2015/.
socat and bash have been added to the child project's Dockerfile, and the external Traefik is configured to use port 2015 of the DinD container. After Compose starts, socat forwards this port to the internal Traefik.
Docker Network Management
Initially, connecting DinD to docker_default was added directly to buildAndRunProject, but it was decided not to leave this hardcoded. The network should be managed explicitly via the API.
Added:
DockerContainerNetworktype (name,networkID,ipAddress,gateway,macAddress);- lazy field
DockerContainer.networks; - helper
mapContainerNetworks; - query
containerNetworks; - mutation
connectContainerToNetwork; - mutation
disconnectContainerFromNetwork.
Now a container can be programmatically connected to the external Traefik network and disconnected from it without using the Docker CLI.
Identified Nuance
If a container is connected to a network after the route has already been established, the external Traefik may continue using the old endpoint. In the conducted test, a Traefik restart was required. This should be taken into account for the future lifecycle of project startup and routing.
Automate the connection of launched projects to the shared Traefik network without manual Docker operations.