Conditionally ignoring a .dockerignore file on COPY
Currently there is no such way where you can provide a different .dockerignore
file.
As an alternative, you can copy the node_modules
to a different directory such as ./node_new_module
using cp
on the host OR probably integrate that cp
command in your CI.
After that you can use the new ./node_new_module
to copy node modules in your Dockerfile -
COPY ./node_new_modules/* node_modules/
Hope this helps or gives you a way to solve this problem.