You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 22-minimal/README.md
+46
Original file line number
Diff line number
Diff line change
@@ -215,6 +215,12 @@ Application developers can use the following environment variables to configure
215
215
**`NPM_RUN`**
216
216
Select an alternate / custom runtime mode, defined in your `package.json` file's [`scripts`](https://docs.npmjs.com/misc/scripts) section (default: npm run "start"). These user-defined run-scripts are unavailable while `DEV_MODE` is in use.
217
217
218
+
**`NODE_CMD`**
219
+
When specified (e.g.Specify `NODE_CMD="node server.js"`) the value of `NODE_CMD` is used to start the application instead of `npm start`.
220
+
221
+
**`INIT_WRAPPER`**
222
+
When set to "true", the application is started via the `init-wrapper` script instead of using `npm start`, by looking for the presence of the files `server.js`, `index.js` or `main.js` in the order in which they are listed. In case of `NODE_CMD` environemnt variale is specified, then `init-wrapper` script will use the value of `NODE_CMD` to start your application.
223
+
218
224
#### Additional variables used in the full-sized image
219
225
220
226
**`HTTP_PROXY`**
@@ -316,7 +322,47 @@ Below is an example _package.json_ file with the _main_ attribute and _start_ sc
316
322
#### Note:
317
323
`oc rsync` is only available in versions 3.1+ of OpenShift.
318
324
325
+
## init-wrapper
326
+
327
+
init-wrapper script is located on `/usr/libexec/s2i/init-wrapper` and is used to handle:
328
+
329
+
- Proper signal handling and propagation, as Node.js was not designed to run as PID 1.
330
+
- Reaping zombie child processes
331
+
Avoiding use of npm, there is more information on why you want to avoid that in the [Node.js reference architecture](https://github.com/nodeshift/nodejs-reference-architecture/blob/e4c4dc1fd20c2cac392e862859aaad27f85d504f/docs/development/building-good-containers.md#avoiding-using-npm-to-start-application). When the INIT_WRAPPER is set to true the application is started via the init script instead of using npm start.
332
+
333
+
A detailed explanation on how the init-wrapper script works is avalable in
Copy file name to clipboardExpand all lines: 22/README.md
+47
Original file line number
Diff line number
Diff line change
@@ -142,6 +142,12 @@ Application developers can use the following environment variables to configure
142
142
**`NPM_BUILD`**
143
143
Select an alternate / custom build command, defined in your `package.json` file's [`scripts`](https://docs.npmjs.com/misc/scripts) section (default: npm run "build"). These user-defined run-scripts are unavailable while `DEV_MODE` is in use.
144
144
145
+
**`NODE_CMD`**
146
+
When specified (e.g.Specify `NODE_CMD="node server.js"`) the value of `NODE_CMD` is used to start the application instead of `npm start`.
147
+
148
+
**`INIT_WRAPPER`**
149
+
When set to "true", the application is started via the `init-wrapper` script instead of using `npm start`, by looking for the presence of the files `server.js`, `index.js` or `main.js` in the order in which they are listed. In case of `NODE_CMD` environemnt variale is specified, then `init-wrapper` script will use the value of `NODE_CMD` to start your application.
150
+
145
151
**`NPM_RUN`**
146
152
Select an alternate / custom runtime mode, defined in your `package.json` file's [`scripts`](https://docs.npmjs.com/misc/scripts) section (default: npm run "start"). These user-defined run-scripts are unavailable while `DEV_MODE` is in use.
147
153
@@ -244,6 +250,47 @@ Below is an example _package.json_ file with the _main_ attribute and _start_ sc
244
250
#### Note:
245
251
`oc rsync` is only available in versions 3.1+ of OpenShift.
246
252
253
+
## init-wrapper
254
+
255
+
init-wrapper script is located on `/usr/libexec/s2i/init-wrapper` and is used to handle:
256
+
257
+
- Proper signal handling and propagation, as Node.js was not designed to run as PID 1.
258
+
- Reaping zombie child processes
259
+
Avoiding use of npm, there is more information on why you want to avoid that in the [Node.js reference architecture](https://github.com/nodeshift/nodejs-reference-architecture/blob/e4c4dc1fd20c2cac392e862859aaad27f85d504f/docs/development/building-good-containers.md#avoiding-using-npm-to-start-application). When the INIT_WRAPPER is set to true the application is started via the init script instead of using npm start.
260
+
261
+
A detailed explanation on how the init-wrapper script works is avalable in
0 commit comments