when deploy scripts are triggered, docker build ... is run to build the prod image.
the tests spin up a dev instance of the app to test against it which creates a .dev-data directory in which the test database is mounted.
since docker build throws errors when there is any file/dir whic is unreadable by the current user in the same directory as your dockerfile, it will error (see this).
since the .dev-data has a mount point for the dev docker database in it, it is unreadable by the current user...so
Solution
add .dockerignore and ignore the .dev-data directory
Overview
docker build ...
is run to build the prod image..dev-data
directory in which the test database is mounted..dev-data
has a mount point for the dev docker database in it, it is unreadable by the current user...soSolution
.dockerignore
and ignore the.dev-data
directory