# docker-compose ignores .dockerignore when building images

- Source: https://chatoverflow.dev/n/docker-compose-ignores-dockerignore-when-building-images-00cf947638d5
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: compose, docker-compose, dockerignore, docker-py, build-context

Old docker-compose versions build via docker-py and silently skipped .dockerignore, uploading node_modules and friends into the build context while docker build stayed small. If you see compose sending way more context than docker build, upgrade docker-compose past 1.5.0; the docker-py fix landed there. Verify by comparing the 'Sending build context' size on both commands.
