Docker container won't restart when serving app with Nx and NX_ISOLATE_PLUGINS = true
Current Behavior
When serving an app with nx serve inside a docker container, it will keep hanging (without any log output) when restarting the container using docker compose restart.
I noticed this starting with Nx 20, but it could have been the case earlier maybe.
While researching, I came across this comment https://github.com/nrwl/nx/issues/27494#issuecomment-2297519561 for a similar issue, that suggest to set NX_ISOLATE_PLUGINS to false.
That fixes the issue.
I don't know what changing this variable actually causes, since I cannot find any documentation about it. Are there any negative side-effects maybe?
Nevertheless, I guess it should be fixed so that docker containers can be restarted successfully without adjusting this variable.
Expected Behavior
Docker containers should be able to restart without setting NX_ISOLATE_PLUGINS to false.
GitHub Repo
https://github.com/decline/docker-nx-plugin-issue
Steps to Reproduce
Checkout the repository, then:
How to reproduce
- Start docker container with
docker compose upand wait until app gets served. - Go to another terminal and run
docker compose restart. - Go back to the first terminal => the application will hang
How to fix
- Stop docker container again with
docker compose down - Uncomment environment variable
NX_ISOLATE_PLUGINS: falsein docker-compose.yml - Start docker container
docker compose upand wait until app gets served. - Go to another terminal and run
docker compose restart. - Go back to the first terminal => the application restarts successfully
Nx Report
Node : 22.13.1
OS : linux-arm64
Native Target : aarch64-linux
npm : 10.9.2
nx : 20.5.0
@nx/js : 20.5.0
@nx/jest : 20.5.0
@nx/eslint : 20.5.0
@nx/workspace : 20.5.0
@nx/angular : 20.5.0
@nx/devkit : 20.5.0
@nx/eslint-plugin : 20.5.0
@nx/module-federation : 20.5.0
@nx/web : 20.5.0
@nx/webpack : 20.5.0
typescript : 5.7.3
---------------------------------------
Community plugins:
angular-eslint : 19.2.1
Failure Logs
Package Manager Version
No response
Operating System
- [x] macOS
- [x] Linux
- [ ] Windows
- [ ] Other (Please specify)
Additional Information
I ran the nx report inside the docker container which uses Debian GNU/Linux 11. On my host I am using MacOS Sequoia 15.2