.dockerignore - exclude directory except certain file-types
You should change the ignore file as follow:
/src/*!/src/*.json!/src/**/*.json
The reason is that !/src/**/*.json
searches for json files inside subfolder of /src
, and not in /src
itself too.
Look at the official documentation if you need further info https://docs.docker.com/engine/reference/builder/#dockerignore-file .