NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
create sample express-application (nodejs) from unit's examples inside docker container
setup arguments as ["nodemon", "--loader", "unit-http/loader.mjs", "--require", "unit-http/loader", "src/server.js"]
docker up
expected: Some kind of error message, like "Can't start application because 'Failed to create Unit object'"
actual: init process hang on step 'Applying configuration /docker-entrypoint.d/config.json'
Unit's logs has the error:
[alert] 24#37 [unit] mmap(11) failed: No such device (19)
/usr/local/lib/node_modules/unit-http/http_server.js:406
this.unit.createServer();
^
Error: Failed to create Unit object
at new Server (/usr/local/lib/node_modules/unit-http/http_server.js:406:15)
at Object.createServer (/usr/local/lib/node_modules/unit-http/http.js:15:12)
at Function.listen (/app/node_modules/express/lib/application.js:634:21)
at Object.<anonymous> (/app/src/server.js:23:5)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at cjsLoader (node:internal/modules/esm/translators:283:17)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:233:7)
Node.js v20.6.1
Aborted
P.S. Looks like unit doesn't support nodemon. With regular node it works fine. But current problem in silent errors!
Unfriendly behavior in some cases.
steps:
expected: Some kind of error message, like "Can't start application because 'Failed to create Unit object'"
actual: init process hang on step 'Applying configuration /docker-entrypoint.d/config.json' Unit's logs has the error:
P.S. Looks like unit doesn't support
nodemon
. With regularnode
it works fine. But current problem in silent errors!Using: unit:1.31.0-node20