nicbet / docker-phoenix

A dockerized Phoenix development and runtime environment.
GNU General Public License v3.0
282 stars 58 forks source link

Install Ruby and htmlbeautifier #16

Closed bradrf closed 3 years ago

bradrf commented 3 years ago

Folks relying on VSCode's remote abilities in conjunction with many code formatters (including the Elixir Templates Formatter) require this tool to be available within the image.

nicbet commented 3 years ago

@bradrf Thanks for opening this PR. If I understand correctly, this PR adds the htmlbeautifier gem for working with this image in VSCode? Ruby thus is a dependency for the gem.

I'd like to keep the base image as clean as possible. Would it be possible to instead add Ruby and htmlbeautifier gem to the .devcontainer instead?

Steps would be roughly:

bradrf commented 3 years ago

That's certainly a reasonable approach if you'd like to keep the image minimal. A downside is that all folks would be forced to build their own local image instead of leveraging a prebuilt one, possibly with different versions of Ruby and/or the Gem. Those can be managed, of course, through pinning of the versions, but seems superfluous. For teams that share work on a project (like mine), we'd probably end up creating our own own image based on this one, instead.

I think it probably comes down to how many folks you think would be using your image as a basis for Elixir/Phoenix work with VScode. If it's a major use case, it might make sense to incorporate it as part of the "base". I'll close the PR for now.

nicbet commented 3 years ago

@bradrf that's certainly one way to customize for your team.

For example, I maintain a a devcontainer repo for rails apps (https://github.com/nicbet/vscode-devcontainer-rails) that has a customization on a per-project basis within one of my teams.

I fully understand where you are coming from, and agree that a "reasonable defaults" type image that needs no further touch can quite be appealing. On the other side, dev environments are quite subjective, and including every possibility in the image may create quite some bloat.

Do you mind if I implement your PR suggestion in the .devcontainer though? I think that would be quite valuable to have.

bradrf commented 3 years ago

Don't mind at all! Not much to it, of course. ;)

nicbet commented 3 years ago

It's on master now. Quite surprised how fast the VSCode devcontainer actually comes up even with Ruby and htmbeautifier gem.