Phabricator的安裝還是挺麻煩的欲主、又有數(shù)據(jù)庫募疮、又有Nginx芍锚。有沒有已經(jīng)做好了的Docker鏡像直接使用昔园?答案肯定是有的。
依賴
安裝
下載docker-compose.yml文件
curl -sSL https://raw.githubusercontent.com/bitnami/bitnami-docker-phabricator/master/docker-compose.yml > docker-compose.yml
修改docker-compose.yml
version: '2'
services:
mariadb:
image: 'bitnami/mariadb:10.3'
environment:
- ALLOW_EMPTY_PASSWORD=yes
- MARIADB_EXTRA_FLAGS=--local-infile=0
volumes:
- 'mariadb_data:/bitnami'
phabricator:
image: 'bitnami/phabricator:2019'
ports:
- '80:80'
- '443:443'
volumes:
- 'phabricator_data:/bitnami'
- '/root/docker/my_vhost.conf:/opt/bitnami/apache/conf/vhosts/my_vhost.conf'
environment:
- PHABRICATOR_PASSWORD=Abc123456
# 可選配置...
depends_on:
- mariadb
volumes:
mariadb_data:
driver: local
phabricator_data:
driver: local
my_vhost.conf文件
<VirtualHost *:80>
ServerName localhost
# 可以修改為域名或者IP
DocumentRoot "/opt/bitnami/phabricator/webroot"
<Directory "/opt/bitnami/phabricator/webroot">
Options Indexes FollowSymLinks Includes execCGI
AllowOverride All
Require all granted
</Directory>
RewriteEngine on
RewriteRule ^/rsrc/(.*) - [L,QSA]
RewriteRule ^/favicon.ico - [L,QSA]
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
</VirtualHost>
啟動(dòng)
docker-compose up -d
啟動(dòng)登錄 http://localhost 會(huì)出現(xiàn)如下類似錯(cuò)誤
Site Not Found
This request asked for "/" on host "localhost", but no site is configured which can serve this request.
登錄容器添加配置
docker exec -ti docker_phabricator_1 bash
/opt/bitnami/phabricator/bin/config set phabricator.base-uri 'http://localhost'
重啟即可
docker-compose restart
可選配置
-
PHABRICATOR_HOST
:Phabricator主機(jī)名并炮。默認(rèn)值:127.0.0.1 -
PHABRICATOR_USERNAME
:Phabricator應(yīng)用程序的用戶名默刚。默認(rèn)值:user -
PHABRICATOR_PASSWORD
:Phabricator應(yīng)用程序密碼。默認(rèn)值:bitnami1 -
PHABRICATOR_EMAIL
:Phabricator應(yīng)用程序電子郵件逃魄。默認(rèn)值:user@example.com -
PHABRICATOR_FIRSTNAME
:Phabricator用戶的名字荤西。默認(rèn)值:FirstName -
PHABRICATOR_LASTNAME
:Phabricator用戶的姓氏。默認(rèn)值:** LastName** -
PHABRICATOR_ALTERNATE_FILE_DOMAIN
:Phabricator文件域。 -
PHABRICATOR_USE_LFS
:將Phabricator配置為使用Git LFS邪锌。默認(rèn)值:no -
PHABRICATOR_SSH_PORT_NUMBER
:SSH服務(wù)器端口勉躺。默認(rèn)值:22 -
PHABRICATOR_ENABLE_GIT_SSH_REPOSITORY
:使用SSH身份驗(yàn)證配置自托管的GIT存儲(chǔ)庫。默認(rèn)值:no -
MARIADB_USER
:MariaDB數(shù)據(jù)庫的根用戶觅丰。默認(rèn)值:root -
MARIADB_PASSWORD
:MariaDB的根密碼饵溅。 -
MARIADB_HOST
:MariaDB服務(wù)器的主機(jī)名。默認(rèn)值:mariadb -
MARIADB_PORT_NUMBER
:MariaDB服務(wù)器使用的端口妇萄。默認(rèn)值:3306
中文漢化
進(jìn)行phabricator
容器
docker exec -ti docker_phabricator_1 bash
cd /opt/bitnami/phabricator/src/extensions
curl -O https://raw.githubusercontent.com/arielyang/phabricator_zh_Hans/master/dist/PhabricatorSimplifiedChineseTranslation.php
語言頁面設(shè)置
http://localhost/settings/user/user/page/language/saved
選擇Chinese(Simplified)保存即可
郵件配置
- 登錄phabricator窗口
2.配置發(fā)送來源
bin/config set metamta.default-address admin@example.com
- 配置smtp
創(chuàng)建mailers.json文件
cat <<EOF > mailers.json
> [
> {
> "key": "stmp-mailer",
> "type": "smtp",
> "options": {
> "host": "smtp.exmail.qq.com",
> "port": 465,
> "user": "admin@example.com",
> "password": "abc123",
> "protocol": "ssl"
> }
> }
> ]
> EOF
導(dǎo)入配置
config set cluster.mailers --stdin < mailers.json
發(fā)送郵件測試
bin/mail send-test --to lake@example.com --subject hello < mailers.json
Reading message body from stdin...
Mail sent! You can view details by running this command:
phabricator/ $ ./bin/mail show-outbound --id 27
HTTPS設(shè)置
登錄容器
設(shè)置允許使用https
config set security.require-https true
nginx轉(zhuǎn)發(fā)配置
server {
listen 443 ssl;
server_name pha.example.com;
ssl_certificate /etc/nginx/conf.d/ssl/example.com.pem;
ssl_certificate_key /etc/nginx/conf.d/ssl/example.com.key;
location / {
proxy_pass https://pha.example.com:8002;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server {
listen 80;
server_name pha.example.com;
rewrite ^(.*)$ https://$host$1 permanent;
}