diff --git a/.docker/onepanel/compose.sample.yaml b/.docker/onepanel/compose.sample.yaml new file mode 100644 index 0000000..2822220 --- /dev/null +++ b/.docker/onepanel/compose.sample.yaml @@ -0,0 +1,46 @@ +networks: + 1panel-network: + driver: bridge + external: true +services: + web: + image: ghcr.io/cedar2025/xboard:new + volumes: + - ./.docker/.data/redis/:/data/ + - ./.env:/www/.env + - ./.docker/.data/:/www/.docker/.data + - ./storage/logs:/www/storage/logs + - ./storage/theme:/www/storage/theme + environment: + - docker=true + depends_on: + - redis + # network_mode: host + networks: + - 1panel-network + command: php artisan octane:start --host=0.0.0.0 --port=7001 + restart: on-failure + ports: + - 7001:7001 + horizon: + image: ghcr.io/cedar2025/xboard:new + volumes: + - ./.docker/.data/redis/:/data/ + - ./.env:/www/.env + - ./.docker/.data/:/www/.docker/.data + - ./storage/logs:/www/storage/logs + restart: on-failure + # network_mode: host + command: php artisan horizon + networks: + - 1panel-network + depends_on: + - redis + redis: + image: redis:7-alpine + command: redis-server --unixsocket /data/redis.sock --unixsocketperm 777 --save 900 1 --save 300 10 --save 60 10000 + restart: unless-stopped + networks: + - 1panel-network + volumes: + - ./.docker/.data/redis:/data diff --git a/docs/1panel安装指南.md b/docs/1panel安装指南.md index 0e9d96f..de1a3ee 100644 --- a/docs/1panel安装指南.md +++ b/docs/1panel安装指南.md @@ -62,11 +62,16 @@ apt update && apt install -y git yum update && yum install -y git # 克隆代码 -git clone -b compose-new --depth 1 https://github.com/cedar2025/Xboard ./ +git clone -b new --depth 1 https://github.com/cedar2025/Xboard ./ + +# 复制配置文件 +cp .docker/onepanel/compose.sample.yaml compose.yaml # 安装依赖并初始化 docker compose run -it --rm web php artisan xboard:install ``` +> ⚠️ Mysql的连接地址需要使用1panel中Mysql菜单中连接信息里的容器连接地址,而不是本地的localhost地址。 +![示例图](./images/1panel_mysql.png) > 安装时选择使用内置 Redis,并输入之前创建的数据库信息 > 安装完成后请保存返回的后台地址和管理员账号密码 diff --git a/docs/images/1panel_mysql.png b/docs/images/1panel_mysql.png new file mode 100644 index 0000000..3b159ba Binary files /dev/null and b/docs/images/1panel_mysql.png differ