javaWeb学习

使用 docker 部署 Redmine 项目管理系统

2019-10-06  本文已影响0人  柳厌之

说明文档

请见:https://hub.docker.com/r/sameersbn/redmine#introduction

拉取非官方镜像

原因是可以自己配置外部的mysql、主题等。

docker pull sameersbn/redmine:4.0.4

数据存储

mkdir -p ~/redmine

进入mysql进行配置

mysql -uroot -p
CREATE USER 'redmine'@'%.%.%.%' IDENTIFIED BY 'password';
CREATE DATABASE IF NOT EXISTS `redmine_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `redmine_production`.* TO 'redmine'@'%.%.%.%';

安装插件和主题

插件

可用插件: Redmine Plugins Directory.

mkdir -p ~/redmine/plugins
cd ~/redmine/plugins
# 简单复制即可,例如:
git clone https://github.com/Ilogeek/redmine_issue_dynamic_edit.git
git clone https://github.com/paginagmbh/redmine_lightbox2.git
# git clone https://github.com/mikitex70/redmine_drawio.git
git clone https://github.com/haru/redmine_theme_changer

还有一些免费插件,百度云分享:

链接: https://pan.baidu.com/s/11JFDoTvL4fR3ZhlrAKan7w 提取码: d7v4

如果你运行了镜像之后又安装了插件,怎么办?

docker exec -it redmine redmine-install-plugins

主题

可用主题: Redmine Themes Directory

mkdir -p ~/redmine/themes
cd ~/redmine/themes
git clone https://github.com/makotokw/redmine-theme-gitmike.git gitmike
git clone https://github.com/mrliptontea/PurpleMine2.git
git clone https://github.com/yenihayat/redmine-theme-yh.git

如果你运行了镜像之后又安装了主题,怎么办?

docker exec -it redmine redmine-install-themes

准备运行

运行镜像

docker run --name=redmine -d \
  --restart=always \
  --env='DB_ADAPTER=mysql2' \
  --env='DB_HOST=172.18.0.1' --env='DB_NAME=redmine_production' \
  --env='DB_USER=redmine' --env='DB_PASS=password' \
  --env='SMTP_USER=support@dfface.com' --env='SMTP_PASS=*****' \
  --volume=/root/redmine:/home/redmine/data \
  --publish=8085:80  \
  --env='REDMINE_PORT=8085' \
  sameersbn/redmine:4.0.4

请耐心等待!

如果是-it,我们可以看到它会进行这些操作,所以等上10分钟也未尝不可:

Initializing logdir...
Initializing datadir...
Symlinking dotfiles...
Installing configuration templates...
Configuring redmine...
Configuring redmine::database
Configuring redmine::unicorn...
Configuring redmine::secret_token...
Generating a session token...
Note:
  All old sessions will become invalid.
  Please specify the REDMINE_SECRET_TOKEN parameter for persistence.
  **SHOULD** be defined if you have a load-balancing Redmine cluster.
Configuring redmine::max_concurrent_ajax_uploads...
Configuring redmine::sudo_mode...
Configuring redmine::autologin_cookie...
Configuring redmine::email_delivery...
Configuring redmine::backups...
Configuring nginx...
Configuring nginx::redmine...
Installing plugins...
Installing gems required by plugins...
Migrating plugins. Please be patient, this could take a while...
Installing themes...
2019-10-06 14:04:40,389 CRIT Supervisor running as root (no user in config file)
2019-10-06 14:04:40,390 WARN Included extra file "/etc/supervisor/conf.d/cron.conf" during parsing
2019-10-06 14:04:40,391 WARN Included extra file "/etc/supervisor/conf.d/nginx.conf" during parsing
2019-10-06 14:04:40,391 WARN Included extra file "/etc/supervisor/conf.d/unicorn.conf" during parsing
2019-10-06 14:04:40,402 INFO RPC interface 'supervisor' initialized
2019-10-06 14:04:40,402 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2019-10-06 14:04:40,403 INFO supervisord started with pid 1
2019-10-06 14:04:41,405 INFO spawned: 'unicorn' with pid 252
2019-10-06 14:04:41,406 INFO spawned: 'cron' with pid 253
2019-10-06 14:04:41,414 INFO spawned: 'nginx' with pid 254
2019-10-06 14:04:42,838 INFO success: unicorn entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-10-06 14:04:42,839 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-10-06 14:04:42,840 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

登录

请等待一两分钟后再访问网页 http://localhost:8085(我已经部署到阿里云上了所以对应网址会有变化,但你看端口还是8085哈):

用户名: admin
密码: admin

效果示例:

写文不易,感谢赞赏!


dfface 的版权声明:所有文章除特别声明外,均采用 CC BY-NC-SA 4.0
许可协议。转载请注明出处,严禁商业用途!

上一篇下一篇

猜你喜欢

热点阅读