XBackBone:一个简单轻量的PHP文件管理器

XBackBone是一个UI漂亮且轻量的PHP文件管理器,数据库可以直接使用内置的SQLite,下面使用Docker部署。

安装docker和docker-compose:

apt -y update
apt -y install curl
curl -sSL https://get.docker.com/ | sh
systemctl start docker
systemctl enable docker
curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

创建需要用到的文件:


touch /opt/traefik/acme.json && chmod 600 /opt/traefik/acme.json

创建traefik的配置文件:

nano /opt/traefik/traefik.toml

写入如下配置(邮箱替换成你自己的):

defaultEntryPoints = ["https","http"]

[entryPoints]
  [entryPoints.http]
  address = ":80"
    [entryPoints.http.redirect]
    entryPoint = "https"
  [entryPoints.https]
  address = ":443"
  [entryPoints.https.tls]

[acme]
email = "example@qq.com"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
[acme.httpChallenge]
entryPoint = "http"

创建traefik的docker-compose:

nano /opt/traefik/docker-compose.yml

写入下面的内容:

version: '3.5'

services:
    reverse-proxy:
      container_name: traefik
      image: traefik:v1.7
      command: --api --docker
      ports:
        - "80:80"
        - "443:443"
      networks:
        - traefik
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
        - /opt/traefik/traefik.toml:/traefik.toml
        - /opt/traefik/acme.json:/acme.json

networks:
    traefik:
      name: imlala

进入到docker-compose.yml所在的目录up起来即可完成traefik的配置:

cd /opt/traefik
docker-compose up -d

新建需要用到的目录/给予正确的权限:

mkdir -p /opt/xbackbone /opt/xbackbone/database /opt/xbackbone/storage
chown -R 1000:1000 /opt/xbackbone/database /opt/xbackbone/storage

新建一个docker-compose.yml:

nano /opt/xbackbone/docker-compose.yml

traefik反代写入如下内容:

version: '3.5'

services: 
    xbackbone:
        container_name: xbackbone
        image: imlala/xbackbone-apache:latest
        environment:
            - WEB_URL=https://xb.233.fi
            - APP_NAME=IMLALA 
            - PHP_MAX_EXECUTION_TIME=600
            - PHP_MEMORY_LIMIT=1024M
            - PHP_POST_MAX_SIZE=10240M
            - PHP_UPLOAD_MAX_FILESIZE=10240M
            - FPM_MAX_REQUESTS=500
            - FPM_PM_MAX_CHILDREN=20
            - FPM_PM_START_SERVERS=10
            - FPM_PM_MIN_SPARE_SERVERS=5
            - FPM_PM_MAX_SPARE_SERVERS=15
        labels: 
            - "traefik.frontend.rule=Host:xb.233.fi"
        volumes:
            - ./storage:/app/storage
            - ./database:/app/resources/database
        restart: unless-stopped

networks:
    default:
        external:
            name: imlala

注:

  1. WEB_URL=后面的域名需要修改成你自己的,此外WEB_URL=域名开头必须是https://的形式。
  2. traefik.frontend.rule=后面的域名也要改成你自己的。

没问题的话进到你的docker-compose目录up起来即可:

cd /opt/xbackbone
docker-compose up -d

访问你的域名应该可以看到登录界面,默认的管理员账号密码均是admin。

一些预览:

管理界面:

发表评论

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