SOLVED:
Run using this format:
docker run --rm -u 1000:1000 -v "${PWD}":/usr/src/app -w /usr/src/app node:17 npm run watch
To reproduce the problem:
docker run --rm -u 1000:1000 -v "${PWD}":/usr/src/app -w /usr/src/app node:17 /bin/sh -c "npm install"
docker run --rm -u 1000:1000 -v "${PWD}":/usr/src/app -w /usr/src/app node:17 /bin/sh -c "npm run watch"
Webpack starts up, watcher is working, pressing ctrl+C does not quit the watcher.
docker run --rm -u 1000:1000 -v "${PWD}":/usr/src/app -w /usr/src/app node:17 /bin/sh -c "npm install"
docker run --rm -u 1000:1000 -v "${PWD}":/usr/src/app -w /usr/src/app node:17-alpine /bin/sh -c "npm run watch"
Webpack starts up, watcher is working, pressing ctrl+C terminates the watcher with such error:
npm ERR! path /usr/src/app
npm ERR! command failed
npm ERR! signal SIGINT
npm ERR! command sh -c webpack --config webpack-config.js --watch
npm ERR! A complete log of this run can be found in:
npm ERR! /home/node/.npm/_logs/2022-03-17T12_29_57_811Z-debug-0.log