Add support for docker compose profiles#806
Open
timabell wants to merge 5 commits into
Open
Conversation
This Architecture Decision Record was generated following trying out the stale PR that attempted to add profiles that didn't work for me and was conflicted with latest master. The ADR/plan was generated by discussion with claude code. Seems like a reasonable approach to me.
Latest golang from https://mise.jdx.dev/
Implements the design captured in docs/adr/0001-docker-compose-profile-support.md (jesseduffield#423). Profiles render as pseudo-projects in the project panel; selecting one filters the services and containers panels to the services that activate with that profile, and Up/Down/Restart on the selection use docker compose --profile X invocations. Key choices: - Profile is a flag on Project (IsProfile bool), not a new type. Avoids a generic-type split across the SideListPanel and CommandObject. - Reuse existing command templates (Up, Down, DownWithVolumes, Restart, AllLogs, DockerComposeConfig). NewCommandObject appends --profile X when a profile context is set, so no separate UpProfile/DownProfile/... family is needed. Adds a new Restart template (master had no project-level restart at all). - Discovery via 'docker compose config --profiles' and 'docker compose --profile X config --services', cached on DockerCommand for the session. Soft-fails on error (logs once, caches empty) so the UI degrades to "no profile rows" rather than popping an error. - Per-profile service filtering uses the local project and the profile's service set (default services + profile-X services, per docker semantics). - No new keybinding for project/profile restart in this PR; handler exists for follow-up discussion. - New unit tests cover NewCommandObject --profile injection, GetProfiles caching, GetProfileServices caching, and the soft-fail path. fixes: jesseduffield#423 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Previously hard-coded to Size: 3 (one visible row) on the assumption there was only ever one project. With profile pseudo-projects you can have several rows, but they were hidden until you focused the panel. Sizes to Len()+2 (rows plus borders), clamped to [3, 8] so the single-project case is unchanged and a project with many profiles can't squeeze out the other side panels. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Focus previously switched the box from Size to Weight: 2, giving the panel ~2/7 of the side area regardless of how many rows it had. That also ignored Gui.ExpandFocusedSidePanel — every other side panel only expands on focus when accordion mode is on. Route the project box through the same accordionBox helper as the others. Stays fitted to content normally; expands on focus only when the user opted in. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
timabell
added a commit
to timabell/nixos-config
that referenced
this pull request
May 20, 2026
https://github.com/timabell/lazydocker/tree/feat/docker-compose-profiles - https://github.com/timabell/lazydocker/tree/feat/docker-compose-profiles - Add support for docker compose profiles by timabell · Pull Request #806 · jesseduffield/lazydocker - jesseduffield/lazydocker#806
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for docker compose profiles
The existing PRs didn't work for me so with the assistance of claude code I've made my own patch to add support for docker compose profiles.
I've run this locally on a real project with profiles and seems to work for me.
Sharing the patch as a PR in case it's useful for others.
Thanks for creating lazydocker, it's very useful for dealing with microservices locally.