
Be sure to use the -no-daemon argument because PM2 needs to run in the foreground for the container to work properly.

To start your app with PM2, set the startup command to pm2 start -no-daemon. Starting from Node 14 LTS, the container doesn't automatically start your app with PM2. You can also configure a custom start file with the following extensions:
#DOCKERFILE NVM INSTALL NODE IN SEPARATE SCRIPT SERIES#
The following example specifies the two variables to a series of commands, separated by commas. To run post-build commands, define POST_BUILD_COMMAND.


To run pre-build commands, define PRE_BUILD_COMMAND. PRE_BUILD_COMMAND and POST_BUILD_COMMAND are environment variables that are empty by default. preinstall and postinstall run before and after install, respectively. As described in npm docs, scripts named prebuild and postbuild run before and after build, respectively, if specified.
