devbox icon indicating copy to clipboard operation
devbox copied to clipboard

Support process-compose override

Open natebrunette opened this issue 1 year ago • 3 comments

What problem are you trying to solve?

I want individual developers to be able to override aspects of the process-compose file.

What solution would you like?

Support reading from the process-compose.override.yml file if it exists.

Alternatives you've considered

No response

natebrunette avatar May 21 '24 18:05 natebrunette

One way I've done that for some teams is to use whoami to dynamically load the correct:

devbox services up --process-compose-file ./config/devbox/process-compose/$(whoami).yaml

When you have multiple people with the same laptop name, you can expand on that concept with env variables that are unique per developer.

mootoday avatar Mar 10 '25 01:03 mootoday

I did some digging and found that devbox services up currently ignores any process-compose.override.yaml files. Looking at the CLI code in https://github.com/jetify-com/devbox/blob/5ad68fa84de7f6e95792435084967e7bdded523f/internal/services/config.go#L63-L84

the lookupProcessCompose function only checks for:

  • process-compose.yaml
  • process-compose.yml

But it doesn't include override files that process-compose natively supports.

I've created a reproduction repository https://github.com/boostvolt/devbox-plugins-override with two test cases:

  • test/override-compose: Basic override functionality test
  • test/plugins-override-compose: Plugin-based override test

When running via devbox services up, the override files are ignored. However, when running directly via process-compose, everything works as expected.


Current Workaround: For plugin situations, we're now using this approach in devbox.json:

"up": "process-compose -f .devbox/virtenv/one/process-compose.yaml -f .devbox/virtenv/two/process-compose.yaml -f process-compose.override.yaml up"

This feature would be valuable for allowing individual developers to customize their local development environment without affecting the shared configuration.

boostvolt avatar Sep 02 '25 07:09 boostvolt

After a brief look at the code, @boostvolt and I discovered that this is already possible via the --pc-flags, for example:

devbox services up --pcflags -f=process-compose.overrides.yml

I think this workaround is quite fine for now, but I'd expect to get a built-in way to configure such flags within the devbox.json file. Are there any opinions from contributors/maintainers on how we could expose such a configuration within the devbox.json file to developers?

edited: typo --pc-flags -> --pcflags

janbiasi avatar Nov 19 '25 16:11 janbiasi