Skip to content

Conversation

ggwadera
Copy link
Collaborator

@ggwadera ggwadera commented Sep 11, 2020

While building the containers feature, I was following Node's Docker best practices document, and it says:

When creating an image, you can bypass the package.json's start command and bake it directly into the image itself. First off this reduces the number of processes running inside of your container. Secondly it causes exit signals such as SIGTERM and SIGINT to be received by the Node.js process instead of npm swallowing them.

This seemed like a good idea at the start, but I forgot an important point that was brought up to me: what if the app needs building/compiling?

So this PR fixes this issue, by changing the CMD section in the container creation, to start the app using npm run start. This allows the user to setup the additional steps it's app might need to run.

The readme was also updated to reflect this change.

Executing directly with node didn't allow to run additional commands like compiling for example.
@Cijin Cijin merged commit e40089b into garageScript:master Sep 14, 2020
@ggwadera ggwadera deleted the docker-npm branch September 15, 2020 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants