docker搭建phabricator

系统Ubuntu 16.04.2 LTS

 

关闭防火墙,seliunx

 

更新apt源/etc/apt/sources.list

选择阿里云源作为apt源

 

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

apt-get update

 

安装docker

 

apt-get install docker -y

 

安装docker-compose

 

curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

chmod 755 /usr/local/bin/docker-compose

下载mysql镜像,下载phabricator镜像

 

docker pull mysql

安装完mysql镜像后需要在本地安装mysql客户端apt-get install mysql-client

下载phabricator

docker pull docker pull redpointgames/phabricator

配置mysql镜像

 

先创建个容器

docker run -it -d --name mysql mysql bash

进入容器

docker exec -it mysql bash

进入/etc/mysql/mysql.conf.d目录,设置

max_allowed_packet=33554432

innodb_buffer_pool_size=1600M

echo "max_allowed_packet=33554432">>mysqld.cnf

echo "innodb_buffer_pool_size=1600M">>mysqld.cnf

在mysql数据库里面添加新的访问权限

grant all PRIVILEGES on *.* to root@'127.0.0.1' identified by '123456' WITH GRANT OPTION;

flush privileges;

grant all PRIVILEGES on *.* to root@'192.168.25.63' identified by '123456' WITH GRANT OPTION;

flush privileges;

grant all PRIVILEGES on *.* to root@'docker_pha_1.docker_default' identified by '123456' WITH GRANT OPTION;

flush privileges;

完成后退出容器,并保存为新的镜像

docker commit mysql mysql1

 

本地连接mysql

mysql -uroot -p123456 -h192.168.25.63

 

编写docker-compose 文件

 

version: '2'

services:

mysql:

image: mysql1

ports:

- "3306:3306"

volumes:

- /mysql/data:/var/lib/mysql

- /mysql/conf.d:/etc/mysql/conf.d

pha:

image: redpointgames/phabricator

ports:

- "80:80"

- "443:443"

- "22:22"

- "24:24"

environment:

- MYSQL_HOST=mysql

- MYSQL_USER=root

- MYSQL_PASS=123456

- PHABRICATOR_REPOSITORY_PATH=/ repos

- LANG=en_US.UTF-8

- LC_ALL=en_US.UTF-8

- ENABLE_APCU=true

volumes:

- /phabricator:/srv/phabricator/phabricator/src/extensions

- /pha/repos:/repos

进入PHA配置登录信息

/srv/phabricator/phabricator

覆盖管理员账号

./bin/auth recover admin

这个会重新创建新的admin并会给你一个连接地址,使用给的连接地址进入web页面修改登录方式

第一次登录一定要做认证信息

 

docker搭建phabricator_第1张图片

docker搭建phabricator_第2张图片

做完认证信息以后就可以直接使用账号密码登录了,若第一次登录没有做认证信息,需要。需要返回上面操作,重新覆盖admin账号,生成新的链接

 

在上面会有系统的警告信息,根据警告信息修改对应参数

docker搭建phabricator_第3张图片

 

 

注意事项

在创建用户时邮箱最好不要使用163邮箱,收不到验证邮件

docker搭建phabricator_第4张图片

你可能感兴趣的:(docker)