Ubuntu上安装禅道

使用docker运行禅道,并通过nginx反向代理暴露出去。

前提:

  1. MySQL
  2. Docker
  3. Nginx

准备数据库

create user 'zentao'@'%' identified with mysql_native_password by '123456';
create database zentao;
grant all privileges on zentao.* to 'zentao'@'%';
flush privileges;

运行禅道容器

docker pull pub.zentao.net/app/zentao:latest
docker run -it -v /var/zentao/data -p 20080:80 -e ZT_WEB_ROOT=/zentao -e MYSQL_INTERNAL=false -e ZT_MYSQL_HOST=172.16.0.3 -e ZT_MYSQL_PORT=3306 -e ZT_MYSQL_USER=zentao -e ZT_MYSQL_PASSWORD=123456 -e ZT_MYSQL_DB=zentao hub.zentao.net/app/zentao:latest

我的服务器上安装了MySQL,服务器的ip是172.16.0.3。

此时latest的镜像是18.13.

配置Nginx反向代理

location /zentao {
  proxy_pass http://localhost:20080;
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto $scheme;
}

浏览器访问并进行设置,成功后会跳转到登录页面,登陆页面样式会错乱,需要修改代码,如下

修改禅道代码

进入容器docker exec -it containerId bash。

修改config/my.php,把其中的$config->webRoot = getWebRoot();改成$config->webRoot = ‘/zentao/’;


评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注