Example of a node program converted from typescript into a single binary.
This example imports from a local folder as well as from a npm package on purpose to show both use cases are working.
The
Dockerfileis the most explanatory file in this repository.
make build
docker run --rm node20bin:latestEntire application should be contained in a single .js file.
This can be done using @vercel/ncc, webpack or other build tools.
When using alpine based images, make sure to install libstdc++, because
the node binary requires these libs to be installed.