====== Docker Redmine 公式イメージを使った構築 ====== ===== オフィシャルイメージ ===== こちらのサイトを参考に、docker-compose.yml を作成 https://hub.docker.com/_/redmine ===== docker-compose.yml ===== パスワードなどは、適宜変更する。 また、一旦起動した後に再起動する場合は、REDMINE_NO_DB_MIGRATE を設定しないと、DB 内容が消えてしまう。。。 version: '3.1' services: redmine: image: redmine restart: always ports: - 8080:3000 environment: REDMINE_DB_MYSQL: db REDMINE_DB_PASSWORD: example REDMINE_SECRET_KEY_BASE: supersecretkey REDMINE_NO_DB_MIGRATE: 1 volumes: - redmine-files:/usr/src/redmine/files db: image: mysql:5.7 restart: always environment: MYSQL_ROOT_PASSWORD: example MYSQL_DATABASE: redmine volumes: - redmine-db:/var/lib/mysql volumes: redmine-db: redmine-files: 起動後に admin ユーザーの姓・名を変更しようとすると、エラーになる。。。 ActiveRecord::StatementInvalid: Mysql2::Error: Incorrect string value: '\x..\x..' どうやらマルチバイト文字を保存しようとすると、エラーになる模様。。。 ネットを探すと、同じような症状の方の対策があったため、修正を実施。 ===== 修正用SQL ===== alter database redmine CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; alter table ar_internal_metadata convert to character set utf8mb4; alter table attachments convert to character set utf8mb4; alter table boards convert to character set utf8mb4; alter table changes convert to character set utf8mb4; alter table changeset_parents convert to character set utf8mb4; alter table changesets convert to character set utf8mb4; alter table changesets_issues convert to character set utf8mb4; alter table comments convert to character set utf8mb4; alter table custom_field_enumerations convert to character set utf8mb4; alter table custom_fields convert to character set utf8mb4; alter table custom_fields_projects convert to character set utf8mb4; alter table custom_fields_roles convert to character set utf8mb4; alter table custom_fields_trackers convert to character set utf8mb4; alter table custom_values convert to character set utf8mb4; alter table documents convert to character set utf8mb4; alter table email_addresses convert to character set utf8mb4; alter table enabled_modules convert to character set utf8mb4; alter table enumerations convert to character set utf8mb4; alter table groups_users convert to character set utf8mb4; alter table import_items convert to character set utf8mb4; alter table imports convert to character set utf8mb4; alter table issue_categories convert to character set utf8mb4; alter table issue_relations convert to character set utf8mb4; alter table issue_statuses convert to character set utf8mb4; alter table issues convert to character set utf8mb4; alter table journal_details convert to character set utf8mb4; alter table journals convert to character set utf8mb4; alter table member_roles convert to character set utf8mb4; alter table members convert to character set utf8mb4; alter table messages convert to character set utf8mb4; alter table news convert to character set utf8mb4; alter table open_id_authentication_associations convert to character set utf8mb4; alter table open_id_authentication_nonces convert to character set utf8mb4; alter table projects convert to character set utf8mb4; alter table projects_trackers convert to character set utf8mb4; alter table queries convert to character set utf8mb4; alter table queries_roles convert to character set utf8mb4; alter table repositories convert to character set utf8mb4; alter table roles convert to character set utf8mb4; alter table roles_managed_roles convert to character set utf8mb4; alter table schema_migrations convert to character set utf8mb4; alter table settings convert to character set utf8mb4; alter table time_entries convert to character set utf8mb4; alter table tokens convert to character set utf8mb4; alter table trackers convert to character set utf8mb4; alter table user_preferences convert to character set utf8mb4; alter table users convert to character set utf8mb4; alter table versions convert to character set utf8mb4; alter table watchers convert to character set utf8mb4; alter table wiki_content_versions convert to character set utf8mb4; alter table wiki_contents convert to character set utf8mb4; alter table wiki_pages convert to character set utf8mb4; alter table wiki_redirects convert to character set utf8mb4; alter table wikis convert to character set utf8mb4; alter table workflows convert to character set utf8mb4; ===== メール送信設定 ===== メールの設定は、/usr/src/redmine/config/configuration.yml に記述する。 とりあえず、docker-compose.yml を置いたディレクトリに configuration.yml を作成 default: email_delivery: delivery_method: :smtp smtp_settings: address: "smtp.your.external.server" port: 587 authentication: :login domain: 'my.domain.net' user_name: 'smtp_user_name' password: 'smtp_user_password' これを docker-compose で読み込むよう、ボリュームマッピングする。 version: '3.1' services: redmine: ... volumes: - ./configuration.yml:/usr/src/redmine/config/configuration.yml - redmine-files:/usr/src/redmine/files ===== Todos ===== * Nginx 経由の Reverse Proxy で SSL 化する * 定期バックアップを取得する