decidim / docker

Docker images for decidim
https://decidim.org
12 stars 18 forks source link

Publish docker images using Github actions, and to Github registry #49

Closed oliverbarnes closed 3 years ago

oliverbarnes commented 3 years ago

Hello,

As mentioned on Telegram, as per a chat with @andreslucena, I'm looking into ways to improve the dev experience using Decidim through Docker.

I'm still wrapping my head around how current Docker usage has been happening, and would like to hear more from people actually using it day to day, of course. Please ping me on Gitter about use cases and pain points.

One of my first impressions was that Docker builds and publishing could be further automated, so that latest versions are readily available, perhaps with a base set of most used decidim modules. Specially for users new to Decidim and first trying it out, and new users without knowledge of the Rails stack, something Andrés brought up as well.

I think using Github Actions and Registry for automating the build and publishing of images might be a good step ., and so I've started on a POC workflow on a fork of this repo:

oliverbarnes/decidim-docker#1

A PR for this has been submitted here: https://github.com/decidim/docker/pull/50

The published image can be found here (it's based on the main Dockerfile):

https://github.com/oliverbarnes/decidim-docker/packages/476747

It's also tagged by SHA and Decidim version:

https://github.com/oliverbarnes/decidim-docker/packages/476747/versions

Thoughts?

Update

Now working with both Ruby and Decidim versions fetched from the decidim/decidim repo.

Proof of concept PR was closed in favor of a more definitive PR

josepjaume commented 3 years ago

Hi @oliverbarnes - this is just tangentially related, but I recently made a PR (unmerged) on Decidim adding support for Visual Code Remote Containers (https://github.com/decidim/decidim/pull/6638), which is a way to ease development with Docker images and containers (and related services) with Visual Code. Been using it exclusively for months now and it works like a charm.

On top of it, it's portable across Operating Systems - I've been able to work with Windows, Mac and Linux without any issues (which is mind-blowing if you ask me!).

oliverbarnes commented 3 years ago

Hi @josepjaume, that is pretty cool VisualCode has that! I wasn't aware, need to try it some time.

That said, it doesn't sound like a Decidim core concern, to me. You might try submitting a PR here on decidim/docker and hear what the maintainers have to say. My own take is that editor-specific configs aren't within scope here either. Keep in mind they'd have to worry about maintaining it in the future, together perhaps with other editor's configs for docker support. And there's many editors out there :)

My suggestion would be to create your own repo (or gist), and use the image up on docker hub that gets generated from the Dockerfile here on your config.

Then perhaps blog about it, or submit an entry to the docs?

josepjaume commented 3 years ago

Hi @oliverbarnes - thanks for the reply. Yes it is pretty cool! :D

The thing about is that the configuration kinda needs to live inside the repository for Visual Code to pick it up and streamline the development process. But there's a twist - the same configuration works with GitHub Codespaces so you can launch a whole decidim development environment on your browser - which kind of makes it not that editor-specific, as we're using GitHub to host our code, in the end. I have a beta invitation and already tried and it works like pure magic - it even spins up the database (specified in a docker-compose.yml file) and proxies the app to a URL. I will definitely blog about it sometime!

Oh BTW, the PR I send is already using decidim-dev as its base image!

oliverbarnes commented 3 years ago

I really have to play with it to discuss further, and we should discuss it in decidim/decidim#6638. Like you said yourself, the issues aren't directly related. I do want to hear about people's daily experience with docker and decidim, but not on this issue per-se. I'll update the issue description to clarify this.

virgile-dev commented 3 years ago

@oliverbarnes a few people are looking into this right now at open source politics. Would you like to join forces ?

oliverbarnes commented 3 years ago

@virgile-dev yeah, for sure! any issues or PRs I can look at, or would you like to hop on a call?

virgile-dev commented 3 years ago

I'll start a telegram group see where it leads us. @oliverbarnes

oliverbarnes commented 3 years ago

As an update, the POC now fetches both Ruby and Decidim versions from the decidim/decidim repo. See the PR for more details

andreslucena commented 3 years ago

Awesome! The only reason that we're still using CircleCI for building these images is that it was already done like that (legacy). Starting with the migration of decidim/decidim repo to GA (see https://github.com/decidim/decidim/pull/5843) making this change is great for consistency.

oliverbarnes commented 3 years ago

Moved the PR from my fork unto decidim/docker, and it's now open for proper review: https://github.com/decidim/docker/pull/50