forked from mu-semtech/mu-javascript-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Add documentation to allow overriding port and hostname #1
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
Open
MPParsley
wants to merge
127
commits into
MPParsley:patch-1
Choose a base branch
from
mu-semtech:master
base: patch-1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Allow overriding port and hostname * Update server.js * Update Dockerfile
* Allow overriding port and hostname * Update server.js * Update Dockerfile * Update Dockerfile * Update README.md
also moves to buildx which should give us arm64 support as well
Shifting to debian means we need to explicitly use bash. When using the node debugger through chromium based browsers (such as Brave) the node debugger fails to connect to the nodejs inspector. Together with @erikap we inspected the packets and it seems nodejs does not accept incoming connections on the ipv6 address as its hostname. It is unclear why it does so. It does accept connections on the specific ipv4 address 127.0.0.1. Searching for solutions it seems Debian Bookworm uses different basic settings (though it is unclear which those are exactly) that do make this case work. In case of alpine there seems to be an ipv6 incompatibility. Explicitly adding 127.0.0.1:9229 as an inspect target makes things work. Explicitly binding an ipv4 port in Docker (making it drop the IPv6 port) makes things work too. Using an older NodeJS version (up to alpine node:15) also makes it work. We therefore conclude this is a compatibility issue and decide not to dig further. We have dug into the packages. We have searched online. People seem to accept this is the state of NodeJS and lacking deep dive guides regarding nodejs, this seems to be the most straight path forward.
`$CI_COMMIT_SOURCE_BRANCH` is only set in a PR context and not in a regular push context. In a regular push context `$CI_COMMIT_BRANCH` should be used
New features since 1.6.0: - Upgrade to Node 18 - Decorators support changed to proposed version 2023-05 (expect to be updated in the future) - Allow overriding hostname and port - Documentation on handling delta's in a microservice - Setup automated builds with Woodpecker
it makes sense for base images to support a wider set of platforms.
* Adapted README to divio * Imported Building a microservice with Express * Split tutorials and add how-to guides * Update reference documentation on framework and imports * Move adding dependencies and delta handling from refernce to how-to's --------- Co-authored-by: Erika Pauwels <[email protected]>
Add documentation on custom build commands in startup.sh
When compiling copy over the non compilable files. typically these are supporting files like json files, hbs, templates, ... that are expected by the app.
No functional change. Being consistent with syntax in existing files.
…-import' into feature/seperate-server-start
We don't need a separate image for running the scripts. The latest mu-cli will run the scripts in the current image which is good enough for this purpose.
- No race conditions on restart - Generate package-lock.json for service dependencies - Auto-install node_modules for development - Correctly use npm install and npm ci on first start and reload Co-author @madnificent
node_modules should be recreated when building production.
beforeExit allows to run a series of commands before exit occurs. The function is async. - setExitHandler is an unpublished escape hatch not intended for public use - exitHandler is not intended for public use but is necessary in start-server.js which has been given its own file nodemon has been removed watchman has its own set of issues. It is not clear when they appear exactly but the issues suggest our current approach may work in our current setting. Because we have not seen any extra errors during testing we'll accept this as being as good as it gets. We switched because nodemon has some open issues and we could not get it to reliably forward signals necessary to clean up state during development.
Needed updates because it uses internals.
Removed console.log which wasn't needed and updated variable names so code checkers are happier.
Could find no uses of these prefixes in the wild so there is a very slim chance this is breaking. It may however break within new microservices because mu is not defined to be the commonly accepted value for the prefix. Better be explicit for now.
This script at least ensures it looks the same in various services. A more streamlined solution may be preferred in the future.
buildx sets the env var if we specify it. Regular docker build doesn't seem to do so. This solution is not pretty but it tackles the cases we're trying to support now. Perhaps this will make Apple happy.
New features since 1.8.0: - Support for mu auth scopes - Built-in sudo interface - Faster reloads and faster compilation - Code editor hints in dev mode through auto-population of local node_modules - Experimental support for debugger in some editors - Use of package-lock.json for your own sources (auto-generated during dev) - Much faster stopping and reloading - Support for cleaning up when your service stops - The mu package can now be imported without spinning up a server - Packages in package.json are auto-installed without requiring manual restart - Removal of non-standard PREFIXES from standard queries - ES6 Module support
Fixes: - fix service start when running in dev mode without mounted config folder
small fix to the readme: correct code snippet
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Documentation for mu-semtech#47.