# Docker Next Config Mounts

> Use when asked to fix Docker Compose bind mounts for Next.js config so they mount next.config.mjs (not next.config.js) and avoid the next.config.js/ directory bug.

- Skill: `majiayu000/docker-next-config-mounts` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/docker-next-config-mounts`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/docker-next-config-mounts/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/docker-next-config-mounts

---


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:

1. Confirm the repo uses `next.config.mjs`
   - Check that `next.config.mjs` exists at the expected path.

2. Fix compose files
   - Replace mounts of `next.config.js` with `next.config.mjs`.
   - Prefer read-only mounts: `:ro`.

3. Prevent recurrence
   - Ensure the mounted source file exists in the repo.
   - Optionally add `next.config.js/` to `.gitignore` to prevent accidental commits if it was created previously.

4. Validate
   - Rebuild or restart dev containers as needed.


