When attempting to build the awesome serialport NPM package in Docker using a node alpine image, in usually failes on building the node-gyp package.
There are various workarounds which can be found online, such as this one.
However, the key ingredient is building the serialport package from source, using this line:
npm install serialport --build-from-source=serialport
Here's the full Dockerfile: