项目作者: yoshinorin

项目描述 :
:whale: An easy docker-compose for Redmine (Nginx + Unicorn + MariaDB)
高级语言: Ruby
项目地址: git://github.com/yoshinorin/docker-redmine-orchestration.git
创建时间: 2016-10-04T23:43:53Z
项目社区:https://github.com/yoshinorin/docker-redmine-orchestration

开源协议:MIT License

下载


docker-redmine-orchestration

A easy and fast docker-compose for Redmine (Nginx + Unicorn + MariaDB)

日本語はこちら

Architecture

  • MariaDB 10.5.x
  • Nginx 1.20 (Also you can ignore it)
  • Ruby 2.4.1
  • Unicorn 5.5.5

what is difference between official docker-redmine ?

- Official This application
DB MySQL MariaDB
Web server - Nginx (Also you can ignore it)
Application server webrick or passenger unicorn (Include unicorn worker killer)
Version Control System - Bundled with git

Requirements

  • Higher than Docker compose 3

Overview

Default installed VCS

The git were installed in the Redmine container and the Redmine’s configuration.yml has been already setted up to link git.

Install and execute

Install

  • At first. Download Redmine’s source code using by ./redmine/redmine_download.sh.

  • Second. Please change Redmine’s setting.

    • Redmine’s setting files are contain in the ./redmine/src/config directory.

Docker compose up

Please execute docker-compose up in root directory.

  1. docker-compose up

Please access http://yourdomain:3000.

After first build, please change RAILS_MIGRATE value to 0 in the docker-compose.yml.

Settings

MariaDB

Please change ./mariadb/config/my.cnf.
Also you can change it after build image.

Character set

Default character set is utf8mb4.

User and password

User and paswword are decided when build docker image. You can specify user and password using by docker-compose.yml.

  1. mariadb:
  2. build: ./mariadb
  3. container_name: mariadb
  4. environment:
  5. MYSQL_ROOT_PASSWORD: mypass
  6. MYSQL_USER: redmine
  7. MYSQL_DATABASE: redmine

You can remove MYSQL_ROOT_PASSWORD key in docker-compose.yml, after first docker image build.

If you change MYSQL_USER and MYSQL_DATABASE. You have to change ./redmine/src/config/database.yml and DB_PING_USER and DB_PING_USER_PASSWORD.

  1. redmine:
  2. build: ./redmine
  3. container_name: redmine
  4. environment:
  5. RAILS_MIGRATE: 1
  6. PLUGINS_MIGRATE: 1
  7. DB_PING_USER: redmine
  8. DB_PING_USER_PASSWORD: redmine

Redmine container have to start after MariaDB container. So,
DB_PING_USER and DB_PING_USER_PASSWORD are wait to start MariaDB container.

Directory connecting

The default setting you can’t connect MariaDB directly.
If you want to connect directly, please add below key in mariadb key.

  1. ports:
  2. - "3306:3306"

You can connect MariaDB directory using by 3306 port. Also you can change port number.

nginx

Please change ./nginx/config/nginx.conf.
Also you can change it after build image.

Ignore nginx

If you want ingnore nginx (for example you have already use other webserver.) please commented out nginx key in docker-compose.yml.
And add below key in redmine key.

  1. ports:
  2. - "3000:3000"

HTTPS

You have to change ./nginx/config/nginx.conf and docker-compose.yml.

At first please configure ./nginx/config/nginx.conf.
And change server settings. Below is example.

  1. server {
  2. #NOTE : for TLS connection.
  3. ssl on;
  4. ssl_prefer_server_ciphers on;
  5. ssl_protocols TLSv1.2;
  6. ssl_certificate <key's path in nginx container>
  7. ssl_certificate_key <key's path in nginx container>

Next please change docker-compose.yml. You have to put key on host machine. And mount these keys on nginx container. So you have to specify host key’s path and mount volume path in docker-compose.yml.

  1. #NOTE : TLS key's path for HTTPS
  2. - <host ssl_certificate key's path> : <nginx.conf ssl_certificate key's path>
  3. - <host ssl_certificate_key key's path> : <nginx.conf ssl_certificate_key key's path>

Please change Redmine connection settings to HTTPS using by Redmine’s management console.

Redmine

Please change ./redmine/src/config.
Also you can change it after build image.

Install plugins

Please put plugins in the ./redmine/src/plugins directory.

And please set PLUGINS_MIGRATE key’s value to 1.

  1. redmine:
  2. build: ./redmine
  3. container_name: redmine
  4. environment:
  5. RAILS_MIGRATE: 1
  6. PLUGINS_MIGRATE: 1

After that these plugins were installed

All plugins will install every time when docker compose up. This behavior for flexible install. (User can select what plugin do you use and uninstall every time easily. On the other hand, plugins install when every time starts docker. But, theses process is no effect on data.)

Unicorn server

You can configure unicorn server settings using by docker-compose.yml below directive.

NAME PORPOSE VALUE(DEFAULT)
UNICORN_WORKER_PROCESS Number of unicorn worker processes 2
UNICORN_TIMEOUT Timeout 60
UNICORN_WOKER_KILLER_MEMORY_MIN Memory min threshold. Unit is MB. 192
UNICORN_WOKER_KILLER_MEMORY_MAX Memory max threshold. Unit is MB. 256
UNICORN_WOKER_KILLER_CHECK_CYCLE Unicorn worker killer check cycle. 16
UNICORN_WOKER_KILLER_VERBOSE Unicorn worker killer logging. false

About unicorn-worker-killer settings, please see unicorn-worker-killer repository.

Container’s time zone

If you want to change container’s time zone. Please add TZ key to each container using by docker-compose.yml.

Below is example.

  1. mariadb-storage:
  2. build: ./storage/mariadb-storage
  3. container_name: mariadb-storage
  4. environment:
  5. TZ: Asia/Tokyo
  6. volumes:
  7. - ./storage/mariadb-storage/data:/var/lib/mysql

git

If you integrate git repositories with Redmine. Please create repositories below directory.

You can create some repositories in the directory.

  1. ./storage/git-storage/repositories/<your-repository>

And above directory are mount below directory in Redmine container.

  1. /usr/src/git/<your-repository>

Back up

Please execute backup.sh. Back up files are create in buckups directory by tar format.

Others

You can customize other settings using by docker-compose.yml

Direcroty Hierarchy

  1. .
  2. ├── backups
  3. ├── backup.sh
  4. ├── circle.yml
  5. ├── doc
  6. ├── img
  7. └── overview.png
  8. ├── overview.pptx
  9. └── README_JA.md
  10. ├── docker-compose.yml
  11. ├── images
  12. ├── LICENSE
  13. ├── logs
  14. ├── nginx
  15. └── redmine
  16. ├── mariadb
  17. ├── config
  18. └── my.cnf
  19. └── Dockerfile
  20. ├── nginx
  21. ├── config
  22. └── nginx.conf
  23. └── Dockerfile
  24. ├── README.md
  25. ├── redmine
  26. ├── docker-entrypoint.sh
  27. ├── Dockerfile
  28. ├── Gemfile
  29. ├── README.md
  30. ├── redmine_download.sh
  31. └── src
  32. └── config
  33. ├── configuration.yml
  34. ├── database.yml
  35. └── unicorn.rb
  36. └── storage
  37. ├── git-storage
  38. └── repositories
  39. └── README.md
  40. ├── mariadb-storage
  41. └── data
  42. └── redmine-files
  43. └── files