10
10

More than 5 years have passed since last update.

CentOS 7.4 で Docker の Redmine を動かす

Last updated at Posted at 2017-09-21

Redmine on Docker

遅ればせながら Docker での Redmine の立ち上げを簡単に検証した。

本記事は試してみた系記事なので、運用を考慮して改めて書いた「Redmine を Docker 公式イメージで運用する - Qiita」を参照して欲しい。

インストール

検証環境

  • CentOS 7.4.1708 (minimal)
  • Docker 17.06.2-ce, build cec0b72 (docker-ce-stable)
  • Docker Compose 1.16.1, build 6d1ac21 (GitHub)
  • Redmine 3.4.2 (hub.docker.com/_/redmine)
  • MySQL 5.7.19 (hub.docker.com/_/mysql)

アップデート

yum clean all && yum -y update && reboot

Yum-axelget

yum -y install epel-release && yum -y update && yum -y install yum-axelget

Docker CE

yum -y install yum-utils && \
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && \
yum -y install docker-ce && systemctl start docker && systemctl enable $_

最新版に拘らなければ extras リポジトリに 1.12.6 がある。

Docker Compose

curl -L $(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep download_url | grep 'Linux-x86_64"' | cut -d'"' -f4) -o /usr/local/bin/docker-compose && chmod +x $_

GitHub のダウンロードリンクにはバージョンを指定しないといけないので latest タグから取得している。1
最新版に拘らなければ EPEL リポジトリに 1.9.0 がある。

firewalld

firewall-cmd --permanent --add-service=http{,s} && firewall-cmd --reload

docker-compose up

Redmine の Docker イメージは、公式の redmine と非公式の sameersbn/redmine がメジャーの様子。
https://hub.docker.com/search/?isAutomated=0&isOfficial=0&&q=redmine

公式 Redmine イメージ

cat << "_EOF_" > docker-compose.yml && docker-compose up -d
version: '2.1'
services:
  redmine:
    image: redmine
    ports:
      - 80:3000
    environment:
      REDMINE_DB_MYSQL: db
      REDMINE_DB_PASSWORD: P@ssw0rd
    depends_on:
      - db
    restart: always
  db:
    image: mysql
    environment:
      MYSQL_ROOT_PASSWORD: P@ssw0rd
      MYSQL_DATABASE: redmine
    restart: always
    volumes:
      - ./mysql/my.cnf:/etc/my.cnf
      - ./mysql:/var/lib/mysql
_EOF_

docker-compose up はダウンロードや pull を含めて3分18秒程度ですべて完了した。

sameersbn/redmine イメージ

curl -LO https://raw.githubusercontent.com/sameersbn/docker-redmine/master/docker-compose.yml && \
docker-compose up -d

GitHub に docker-compose.yml が用意されている。
データベースは PostgreSQL 9.6 を利用する模様。

TODO

  • テーマ、プラグインのインストール
  • 初期パラメータの設定
  • 日本語初期設定ロード対応 2
  • メール送信の設定

参考

Redmine 関連記事

10
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10