Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(3062): fix Dockerfile not to use npm start, and add shutdown method #143

Merged
merged 4 commits into from
Mar 22, 2024

Conversation

sakka2
Copy link
Contributor

@sakka2 sakka2 commented Mar 21, 2024

Context

Store server cannot receive SIGTERM, and moreover the store even does not have the method of shutdown like api.

See this issue for details:
screwdriver-cd/screwdriver#3062

Objective

  • Fix Dockerfile as belows:
    • Add tini process
    • Run the service by node ./bin/server directly, not via npm start
  • Add shutdown method

References

Issue: screwdriver-cd/screwdriver#3062
Docker and Node.js Best Practices:
https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#handling-kernel-signals

License

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

/**
* Hapi plugin to handle serve graceful shutdown
* @method register
* @param {Hapi.Server} server

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nits]
Is lint working? It looks like there are many space between {Hapi.Server} and server

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint may not be working. I deleted the space.

plugins/shutdown.js Outdated Show resolved Hide resolved
@DekusDenial DekusDenial merged commit ab32467 into screwdriver-cd:master Mar 22, 2024
1 check passed
@sd-buildbot
Copy link

🎉 This PR is included in version 5.0.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants