Strapi Docker Deployment Sharp Problems

Experienced this same problem. It was because I didn’t have a .dockerignore file in the root directory so the local node_modules folder was getting copied over by docker. It would be helpful if this was mentioned in the Strapi docs for those just getting started with Docker.

Your .dockerignore should contain the following:

.tmp/
.cache/
.git/
build/
node_modules/
.env
data/

If you use @strapi-community/dockerize, it will create this file and your other docker files for you.

4 Likes