Skip to content

Docker container won't restart when serving app with Nx and NX_ISOLATE_PLUGINS = true #30359

Open
@decline

Description

@decline

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 #27494 (comment) 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

  1. Start docker container with docker compose up and wait until app gets served.
  2. Go to another terminal and run docker compose restart.
  3. Go back to the first terminal => the application will hang

How to fix

  1. Stop docker container again with docker compose down
  2. Uncomment environment variable NX_ISOLATE_PLUGINS: false in docker-compose.yml
  3. Start docker container docker compose up and wait until app gets served.
  4. Go to another terminal and run docker compose restart.
  5. 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

  • macOS
  • 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

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions