Goal: ensure Docker Compose mounts the correct Next.js config file and avoid Docker creating a next.config.js/ directory when a bind source path is missing.
Workflow:
Confirm the repo uses
next.config.mjs- Check that
next.config.mjsexists at the expected path.
- Check that
Fix compose files
- Replace mounts of
next.config.jswithnext.config.mjs. - Prefer read-only mounts:
:ro.
- Replace mounts of
Prevent recurrence
- Ensure the mounted source file exists in the repo.
- Optionally add
next.config.js/to.gitignoreto prevent accidental commits if it was created previously.
Validate
- Rebuild or restart dev containers as needed.