Silex / docker.el

Manage docker from Emacs.
738 stars 74 forks source link

FR/RFC: Docker Compose enhancements #229

Open pataquets opened 10 months ago

pataquets commented 10 months ago

docker.el is totally awesome, thanks for sharing. While working with docker-compose.yml files, I've found that no specific actions/mode is enabled. Some enhancements/ideas I'd like to propose and, with proper guidance and if they're in my knowledge range, happy to tackle sometime.

Dumping the idea, so far :smile:

EDIT: Turns out there is already a docker-compose-mode, albeit it seems inactive. Maybe it can be of some help.

LaurenceWarne commented 9 months ago

FWIW, for general editing (e.g. completions) in docker-compose.el files, you can use the yaml language server: https://github.com/redhat-developer/yaml-language-server. If you're an lsp mode user M-x lsp should just work (at least it does for me!).

I've added an entry to auto-mode-alist for it:

(use-package lsp-mode
  :mode "docker-compose.yml"
  ;; ....
)
pataquets commented 8 months ago

Adding meqif/docker-compose-mode to OP.

Silex commented 1 month ago

Sorry I completely missed this issue. It sounds nice, but with my limited time I'm a bit afraid of the complexity of maintaining a docker-compose mode.

Also, maybe design wise I'm not sure if this belongs to docker.el or to docker-compose.el.

About automatically changing to the directory root, this should already happen if you start the transient from the docker-compose.yml file... tho what you describe seems to hint at some projectile-docker-compose mode or smth?

pataquets commented 1 month ago

Sorry I completely missed this issue. It sounds nice, but with my limited time I'm a bit afraid of the complexity of maintaining a docker-compose mode.

Eminently reasonable. Sounds fair enough. Maybe downsizing the feature scope (and clearly set expectations) would be an acceptable solution.

Also, maybe design wise I'm not sure if this belongs to docker.el or to docker-compose.el.

I was also concerned about this at first and I was leaning in doing it in docker-compose.el. However, two things happened since the OP:

These had me 50/50, specially the last one.

About automatically changing to the directory root, this should already happen if you start the transient from the docker-compose.yml file... tho what you describe seems to hint at some projectile-docker-compose mode or smth?

Yup. CWD should change to run DC. Maybe just at the last second, just before calling DC. Also, good call on Projectile integration. I hadn't thought about it, even being a user myself. It sounds very promising, although I'm not that familiar with extending Projectile, but worth considering, anyway. IIRC, Projectile has some sort of find-project-file-at-root or similar and more useful API functions for sure, which could help offloading some functionalities. If you or anyone reading happen to come with some specific idea, please share. I may come back in the future with more info, as my Projectile knowledge improves.