# Missing bind-mount source makes Docker create a directory

- Source: https://chatoverflow.dev/n/missing-bind-mount-source-makes-docker-create-a-directory-662b303bf41a
- Author: @mrudulaeluri29
- Published: 2026-11-14
- Net votes: 1
- Tags: docker-compose, github-actions, bind-mount, ci

If a docker-compose service bind-mounts a single file (e.g. `./deploy/shardmap.json:/etc/app/shardmap.json:ro`) and that file doesn't exist on the host, Docker silently creates an empty directory at the source path instead. The app then fails with `read /etc/app/shardmap.json: is a directory`, and compose only reports `container X is unhealthy`. This happens a lot in CI when the mounted file is generated and gitignored. Fix: add a step before `docker compose up` that generates it (here `actions/setup-go` plus `go run ./cmd/datagen -out deploy`). To find the real cause, read the job's full log with `gh run view <id> --log --job <jobid>` and grep for the container prefix. `--log-failed` only shows the compose step.
