Skip to content

Instantly share code, notes, and snippets.

@mRoca
Last active April 27, 2016 09:00
Show Gist options
  • Save mRoca/039f01d08d5df2cdcde9 to your computer and use it in GitHub Desktop.
Save mRoca/039f01d08d5df2cdcde9 to your computer and use it in GitHub Desktop.
Redmine docker

Redmine image and doc : https://github.com/sameersbn/docker-redmine/

Install

Create containers

Create the docker-compose file:

mkdir -p /srv/docker/images/redmine/
cat docker-compose.yml > /srv/docker/images/redmine/docker-compose.yml
# Edit the docker-compose.yml file

Install plugins

Install usefull plugins :

sudo mkdir -p /srv/docker/redmine/redmine/plugins
cd /srv/docker/redmine/redmine/plugins

git clone https://github.com/peclik/clipboard_image_paste.git

git clone https://github.com/jgraichen/redmine_dashboard.git
cd redmine_dashboard
git fetch --tags
git checkout $(git tag | tail -n1)
# Fixing some gem versions problems
sed "s/gem 'test-unit'/# gem 'test-unit'/" -i Gemfile

bundle install --without development test rmagick
service apache2 reload

Bind git repositories

With Gitlab container on the same host

Uncomment the volumes_from section of the docker-compose.yml file.

You can then add them in the "repo" project section : /home/git/data/repositories/my_namespace/my_repo.git

For more info, see https://github.com/sameersbn/docker-gitlab#external-issue-trackers

If you have the two services on the same host, you should want to use a http proxy to redirect requests by hostname, have a look at https://github.com/jwilder/nginx-proxy

Without Gitlab container on the same host

Clone necessary source code git repo. You can then add them in the "repo" project section : /home/redmine/data/repo/my_repo.git

sudo mkdir -p /srv/docker/redmine/redmine/repo
cd /srv/docker/redmine/redmine/repo

git clone --mirror git@my_repo.git

Add the repo fetch cron job :

cat crontab.sh > /srv/docker/images/redmine/crontab.sh && chmod +x /srv/docker/images/redmine/crontab.sh
crontab -e
# */5 * * * * /srv/docker/images/redmine/crontab.sh

Run

Then, run containers :

cd /srv/docker/images/redmine/
docker-compose up -d

Wait a few minutes, then go to http://localhost:10083/

Summary

  • Redmine docker image folder : /srv/docker/images/redmine
  • Redmine data folder : /srv/docker/redmine/redmine
  • MySQL data folder : /srv/docker/redmine/mysql
#!/bin/sh
cd /srv/docker/redmine/redmine/repo
ls -d *.git/ | xargs -P10 -I{} git -C {} fetch -q --all -p
mysql:
image: sameersbn/mysql:latest
environment:
- DB_USER=redmine
- DB_PASS=redmine_password
- DB_NAME=redmine_production
volumes:
- /srv/docker/redmine/mysql:/var/lib/mysql
redmine:
image: sameersbn/redmine:2.6-latest
links:
- mysql:mysql
environment:
- TZ=Europe/Paris
- REDMINE_PORT=10083
- SMTP_ENABLED=false
- SMTP_DOMAIN=www.domain.com
- SMTP_HOST=smtp.gmail.com
- SMTP_PORT=587
- SMTP_USER=user@domain.com
- SMTP_PASS=passwd
- SMTP_STARTTLS=true
- SMTP_AUTHENTICATION=:login
ports:
- "10083:80"
volumes:
- /srv/docker/redmine/redmine:/home/redmine/data
# volumes_from:
# - gitlab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment