Skip to content

chore(n): honor docker-compose.override.yml for the main dev stack#182

Draft
adekbadek wants to merge 1 commit into
mainfrom
worktree-compose-override
Draft

chore(n): honor docker-compose.override.yml for the main dev stack#182
adekbadek wants to merge 1 commit into
mainfrom
worktree-compose-override

Conversation

@adekbadek
Copy link
Copy Markdown
Member

All Submissions:

Changes proposed in this Pull Request:

n start invokes Docker Compose with an explicit -f docker-compose.yml, which disables Compose's automatic loading of docker-compose.override.yml. As a result, a developer's root override (e.g. extra bind mounts) was silently ignored.

This makes n start append -f docker-compose.override.yml to the Compose invocation only when that file exists, so its settings merge over the base stack. When the file is absent, the invocation is unchanged, so the default behavior is fully preserved.

The override is scoped to the main dev stack (newspack_dev). Isolated environments (n env) intentionally do not load it; they already layer their own generated docker-compose.env-*.yml overrides, and folding a global override into them could clobber env-specific config via file ordering. The override file is gitignored (it's a per-developer customization), and the mechanism is documented in AGENTS.md.

Reported by Wil (Slack thread).

How to test the changes in this Pull Request:

  1. Check out this branch and cp .env into place if needed (or run from your normal workspace with .env present).
  2. Create a throwaway docker-compose.override.yml at the workspace root that adds a bind mount to the wordpress service:
    services:
      wordpress:
        volumes:
          - /tmp/np-override-probe:/var/www/override-probe
  3. Run docker compose -f docker-compose.yml -f docker-compose.override.yml config (what n start now invokes) and confirm the merged output contains the /var/www/override-probe mount. Equivalently, run n start and verify the mount is live: docker exec newspack_dev ls -la /var/www/override-probe.
  4. Delete docker-compose.override.yml, run n start again, and confirm the container comes up exactly as before (no probe mount) – default behavior is preserved when no override is present.
  5. Confirm isolated environments are unaffected: n env up <name> still works and does not pick up the root override.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Makes n start honor a developer-local docker-compose.override.yml for the main dev stack, restoring Compose's standard override behavior that was disabled by the explicit -f flag.

Changes:

  • Append -f docker-compose.override.yml to the docker compose up invocation when the file exists.
  • Gitignore the override file so it stays per-developer.
  • Document the override mechanism in AGENTS.md.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
n Conditionally adds the override file to the compose invocation in start().
AGENTS.md Documents how to customize the main dev stack via docker-compose.override.yml.
.gitignore Ignores the new docker-compose.override.yml file.

n start passes an explicit -f, which disables Compose's automatic
loading of docker-compose.override.yml, so a developer's root override
(e.g. extra bind mounts) was silently ignored. Append the override file
to the invocation when it exists, leaving the default stack unchanged
when absent. Isolated env containers keep their own override path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@adekbadek adekbadek force-pushed the worktree-compose-override branch from 39348e9 to dc4c6a6 Compare June 1, 2026 21:51
@adekbadek adekbadek changed the title fix(n): honor docker-compose.override.yml for the main dev stack chore(n): honor docker-compose.override.yml for the main dev stack Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants