Project

General

Profile

Dockerized Redmine 2.3-stable

Added by Ted Lilley about 11 years ago

Hey everyone,

Just wanted to let anyone know who might be interested, I've posted a Docker image of a Redmine 2.3 instance. If you're interested in containers and wanted to play with Redmine, it's pretty simple to get started once you have Docker installed.

You can find it with all of the explanatory info at https://github.com/binaryphile/docker-redmine.

Cheers.

Ted


Replies (13)

RE: Dockerized Redmine 2.3-stable - Added by Ted Lilley about 11 years ago

I just made a major update to the README on the project. If it wasn't clear how to use the project before, give it a look now.

RE: Dockerized Redmine 2.3-stable - Added by Jean-Baptiste Barth about 11 years ago

Nice effort ! Did you build the image through a Dockerfile ?

I have a (private) repo somewhere on my laptop where I tried to do that but quickly abandoned because docker was missing links/orchestration at the time, but with links just released in 0.6.5 I should give it an other try. How do you manage connection to the postgres/mysql database, entirely through env variable set by the operator ?

RE: Dockerized Redmine 2.3-stable - Added by Ted Lilley about 11 years ago

Actually no, it's strictly through shell scripts. I started with a Dockerfile but ran out of AUFS layers. Every RUN command uses a layer, so by the time I went through installing Ruby, prereqs, source code, gems, etc, the container wouldn't run any more.

It looks like there are still some kinks to be worked on in Docker in that regard. Shell scripts give you more flexibility anyway since you have a full scripting environment with flow control, variables, etc. Rails apps are more complicated than other apps between dev and production modes, so the scripting helps deal with both environments.

If you just want a vanilla Redmine 2.3, you don't even have to build an image anyway, you can just run the one that's already built. Of course, most people will want to customize theirs, so there's a script called create.sh to build a new image. If you base it off my 2.3 image, it's really fast to make a new one, like just a couple seconds.

database.yml looks like this:

    production:
        adapter: <%= ENV['DB_ADAPTER'] %>
        database: <%= ENV['DB_DATABASE'] %>
        host: <%= ENV['DB_HOST'] %>
        username: <%= ENV['DB_USER'] %>
        password: <%= ENV['DB_PASS'] %>

You can pass stuff in through the environment that way, but that's not really secure since it can be picked up by other processes on the same machine sometimes. Because of that I included the dotenv gem, which artificially populates the environment with values from a .env file instead.

I know pg works but haven't tested MySQL. The prereqs are in the image, though, so it should work.

Let me know if you run into any issues, or decide to take a different approach. I'm still batting around ideas to make the process better.

RE: Dockerized Redmine 2.3-stable - Added by Ted Lilley about 11 years ago

I've pushed out some updates to the Redmine docker image recently, thought I'd recap the changes here.

- Redmine source is now external

Prior to this the Redmine source was kept inside the container and only things like `secret_token.rb` and the file attachments directory were kept outside. I eventually kept finding other things to place outside the container, such as the public directory. Eventually it became too difficult to maintain this separation. Now the entire source code tree is kept outside the local container, making it easier to see and work with the files. You can even run a normal development environment on your machine directly and use the same code from inside the container.

You don't have to worry about setting up the source code, however, since my scripts will automatically download the source for you and place it in the proper directory.

- Redmine source is now git cloned

I had been gunzipping a tar of the Redmine source for space-saving purposes, but it is now a full git clone for flexibility.

- Plugins and themes are supported without rebuilding the image

My initial release required you to rebuild your own image if you had plugins or themes (scripts included to do that). However, since the code is now maintained outside the container, you can add your plugins and themes there. The container still provides the convenience of containing all of the binary dependencies for Redmine.

- Gems are pre-cached in the container and copied local

Because plugins require the ability to run bundler and install new gems, gems are now kept outside the container as well in the local .bundle directory. For speed, however, they have been pre-bundled in the image and are copied upon first use to the local directory, which makes bundling a breeze.

- Dockerfile scripts moved to a subdirectory

The main scripts are all kept in the top directory of the repo, however since creating an image is no longer necessary in most cases, the scripts to do so have been moved to a subdirectory named dockerfile.

- Plugin installation script added

The steps to perform plugin installation and migration have been put into a install-plugin.sh script

I'm hoping that people start trying out docker as an easy, light and effective means of deploying Redmine, so I welcome your feedback.

Thanks.

RE: Dockerized Redmine 2.3-stable - Added by dj jones almost 11 years ago

are you planning to release a 2.4 version?

RE: Dockerized Redmine 2.3-stable - Added by Ted Lilley almost 11 years ago

I'm using the Github repository which has no 2.4-stable branch nor tag. Once it becomes available, I will probably update my project.

RE: Dockerized Redmine 2.3-stable - Added by dj jones almost 11 years ago

This thread suggests that the GitHub repository is only a best-effort thing for RedMine, that the only master repository is SVN at remine.org itself
- http://www.redmine.org/issues/11918

It seems that GitHub is certainly not up todate now - 2.3 vs latest stable 2.4.

I wonder if you have thought about building your Docker from SVN at redmine.org direct, instead of GutHub ?

RE: Dockerized Redmine 2.3-stable - Added by Ted Lilley almost 11 years ago

The process requires maintaining my own fork of the code with modifications, which I can't do with SVN. If the github repo trails a bit I'm ok with that. I'll update to 2.4 when it catches up to that branch. It's just not that important to me to be on the very latest code.

RE: Dockerized Redmine 2.3-stable - Added by dj jones almost 11 years ago

The process requires maintaining my own fork of the code with modifications, which I can't do with SVN.

Some people claim to have success with doing that:, e.g.
- Fork remote SVN repo to git
- http://stackoverflow.com/questions/13963010/fork-remote-svn-repo-to-git

But maybe you've tried such approaches and they don't work for this particular situation?

RE: Dockerized Redmine 2.3-stable - Added by Ted Lilley almost 11 years ago

The fact that the existing github mirror is broken would argue otherwise.

RE: Dockerized Redmine 2.3-stable - Added by Jean-Baptiste Barth over 10 years ago

Just FYI, the Github mirror should be fine for 2 months or so now, and I'm now controlling it totally which wasn't the case before (I was relying on a third mirror for synchronizations..).

Don't hesitate to ping me if something bad happens on the github mirror, I'm usually quick to answer by email...

RE: Dockerized Redmine 2.3-stable - Added by Ted Lilley over 10 years ago

Thank you for that. Will do.

RE: Dockerized Redmine 2.3-stable - Added by dj jones about 10 years ago

Over in the Redmine_Appliance page, there is link to a 'Dockerized Redmine from sameersbn' : that project on GitHub seems to be quite active, last update just a few days agao.

https://github.com/sameersbn/docker-redmine

    (1-13/13)