Closed aslafy-z closed 5 years ago
this feels a tad bit too complicated. is there any way to make it simpler? and the size smaller than 19 MB?
I could remove the packaging step but as you can see https://hub.docker.com/r/zadki3l/nexmo/tags/, the 'build' image (tag) is bigger than the 'runtime'.
The node_modules
folder itself is 50MB
so making it smaller would be difficult.
Edit: down to 7.5MB by deleting dev dependencies, but it does not reduce final size.
It's already tiny for a docker image!
Will this PR be eligible to hacktoberfest, even if it's not merged by Oct. 30?
I deleted the package step to be more accessible, it increases the release size by 6MB
to 25MB
compressed.
Not that
node:10-alpine
is24MB
compressed
I'm sorry but we won't be accepting this PR. I'm sure it is useful to someone, but it's not something we want to include in our project and support going forward.
Summary
Add a dockerfile for using/building nexmo-cli
Final runtime image size is
25 MB
compressed It's available to test on the docker hub: zadki3l/nexmoTry it now with:
Other Information
This dockerfile leverage multiple stages builds:
dev
: install dependenciesbuild
: copy project files, build node release code and clean depsruntime
: final production image with built sourceI recommend to append
-u "$(id -u):$(id -g)"
to thedocker run
command to keep permissions clean.Usage
Currently
prepublish
step fail in the docker image (don't know why), will need #187 later.