部署开源项目管理工具focalboard
前言
focalboard是一款开源项目管理工具,类似Jira、Trello。官网地址
组件 | 版本 | 说明 |
Debian | 12.1 | 操作系统 |
docker | 20.10.7 | 容器运行时 |
docker-compose | 1.29.2 | docker编排工具 |
Nginx | 1.21.5 | 反向代理focalboard |
Postgres | 15.3 | 数据库 |
Focalboard | 7.11.3 | focalboard服务 |
安装nginx和postgres
nginx和postgres通过docker安装,免得编译。docker-compose.yaml文件内容如下,根据实际需求进行修改。
version: "3"
services:postgres:image: postgres:latestcontainer_name: postgresnetworks:- appsports:- 5432:5432volumes:- ./postgres/data:/var/lib/postgresql/data- /etc/localtime:/etc/localtime:roenvironment:- "POSTGRES_PASSWORD=123456"nginx:image: nginx:latestcontainer_name: nginxnetworks:- appsvolumes:- ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf- ./nginx/conf/conf.d:/etc/nginx/conf.d- ./nginx/logs:/var/log/nginx- /etc/localtime:/etc/localtime:roports:- 80:80
networks:apps:name: apps
使用docker-compose创建容器并启动:
docker-compose up -d
查看是否启动成功:
docker-compose ps
配置postgres
# 创建数据库
CREATE DATABASE focalboards;
# 创建用户, 指定密码
CREATE USER boardsuser WITH PASSWORD 'qwerty';
# 授权
GRANT ALL PRIVILEGES ON DATABASE focalboards to boardsuser;
配置nginx
upstream中指定了focalboard后端的ip,根据实际进行修改。
upstream svc.focalboard {server 192.168.0.41:8000;keepalive 32;
}
server {listen 80;server_name localhost;#access_log /var/log/nginx/host.access.log main;location ~ /ws/* {proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "upgrade";client_max_body_size 50M;proxy_set_header Host $http_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;proxy_set_header X-Frame-Options SAMEORIGIN;proxy_buffers 256 16k;proxy_buffer_size 16k;client_body_timeout 60;send_timeout 300;lingering_timeout 5;proxy_connect_timeout 1d;proxy_send_timeout 1d;proxy_read_timeout 1d;proxy_pass http://svc.focalboard;}location / {client_max_body_size 50M;proxy_set_header Connection "";proxy_set_header Host $http_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;proxy_set_header X-Frame-Options SAMEORIGIN;proxy_buffers 256 16k;proxy_buffer_size 16k;proxy_read_timeout 600s;proxy_cache_revalidate on;proxy_cache_min_uses 2;proxy_cache_use_stale timeout;proxy_cache_lock on;proxy_http_version 1.1;proxy_pass http://svc.focalboard;}error_page 500 502 503 504 /50x.html;location = /50x.html {root /usr/share/nginx/html;}
}
检查配置与配置热加载
docker exec nginx nginx -t
docker exec nginx nginx -s reload
安装与配置focalboard
- 官网GitHub仓库下载。https://github.com/mattermost/focalboard
- 解压
- 编辑config.json。注意修改postgres数据库的连接信息。
{"serverRoot": "http://localhost:8000","port": 8000,"dbtype": "postgres","dbconfig": "postgres://boardsuser:qwerty@127.0.0.1:5432/focalboards?sslmode=disable&connect_timeout=10","postgres_dbconfig": "dbname=focalboard sslmode=disable","useSSL": false,"webpath": "./pack","filespath": "./files","telemetry": true,"prometheusaddress": ":9092","session_expire_time": 2592000,"session_refresh_time": 18000,"localOnly": false,"enableLocalMode": true,"localModeSocketLocation": "./tmp/focalboard_local.socket"
}
启动
nohup ./bin/focalboard-server > ./nohup.log 2>&1 &
浏览器访问
补充
- focalboard编译用的GLIBC版本较高,centos 7无法正常运行。(报错:
/lib64/libc.so.6: version 'GLIBC_2.28' not found
)。如果要在centos 7上部署focalboard,可以试试自封装的docker镜像。
version: "3"
services:focalboard:image: registry.cn-hangzhou.aliyuncs.com/rainux/focalboard:7.11.3container_name: focalboardnetworks:- appsvolumes:- ./focalboard/config.json:/app/config.json- /etc/localtime:/etc/localtime:roprivileged: true
networks:apps:name: apps