我目前有1P面板 运行了多个网站 如何搭建这个管理系统啊?
开源地址https://github.com/mylxsw/wizard
docker 运行 然后反向代理就可以了
有具体同类型项目教程吗?我看看
官方说明直接运行下面的 Docker 命令即可
docker run -d --name wizard \
-e DB_HOST=host.docker.internal \
-e DB_PORT=3306 \
-e DB_DATABASE=wizard \
-e DB_USERNAME=wizard \
-e DB_PASSWORD=wizard \
-p 8080:80 \
-v /Users/mylxsw/Downloads:/webroot/storage/app/public \
mylxsw/wizard
如果使用Docker Compose 部署
version: '3.8'
services:
# MySQL 数据库服务
mysql:
image: mysql:8.0
container_name: wizard-db
environment:
MYSQL_DATABASE: wizard
MYSQL_USER: wizard
MYSQL_PASSWORD: wizard
MYSQL_ROOT_PASSWORD: root_password # 生产环境需替换为强密码:ml-citation{ref="7" data="citationList"}
volumes:
- wizard_db_data:/var/lib/mysql # 数据库数据持久化:ml-citation{ref="4,7" data="citationList"}
networks:
- wizard-net
healthcheck: # 健康检查确保数据库就绪:ml-citation{ref="7" data="citationList"}
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 3s
retries: 10
# Wizard 应用服务
wizard:
image: mylxsw/wizard:latest
container_name: wizard-app
depends_on:
mysql:
condition: service_healthy # 依赖数据库健康状态:ml-citation{ref="8" data="citationList"}
environment:
DB_CONNECTION: mysql
DB_HOST: mysql # 使用服务名替代host.docker.internal:ml-citation{ref="3,8" data="citationList"}
DB_PORT: 3306
DB_DATABASE: wizard
DB_USERNAME: wizard
DB_PASSWORD: wizard
APP_URL: http://your-domain.com # 必须替换为实际访问地址
APP_DEBUG: "false" # 生产环境禁用调试模式:ml-citation{ref="8" data="citationList"}
volumes:
- wizard_uploads:/webroot/storage/app/public # 文件上传持久化:ml-citation{ref="8" data="citationList"}
ports:
- "8080:80"
networks:
- wizard-net
command: sh -c "php artisan migrate:install && php artisan migrate && apache2-foreground" # 首次部署执行迁移:ml-citation{ref="8" data="citationList"}
networks:
wizard-net:
driver: bridge
volumes:
wizard_db_data: # 数据库数据卷声明
wizard_uploads: # 文件上传目录卷声明
如果使用外面mysql数据库
version: '3.8'
services:
wizard:
image: mylxsw/wizard:latest
container_name: wizard-app
depends_on:
mysql:
condition: service_healthy # 依赖外部 MySQL 的健康状态:ml-citation{ref="3,8" data="citationList"}
environment:
DB_CONNECTION: mysql
DB_HOST: mysql # 直接使用 MySQL 服务名通信:ml-citation{ref="3,8" data="citationList"}
DB_PORT: 3306
DB_DATABASE: wizard # 需与现有 MySQL 数据库名一致:ml-citation{ref="4,7" data="citationList"}
DB_USERNAME: wizard # 需与现有 MySQL 用户名一致
DB_PASSWORD: wizard # 需与现有 MySQL 密码一致
APP_URL: http://your-domain.com
APP_DEBUG: "false" # 生产环境禁用调试:ml-citation{ref="8" data="citationList"}
volumes:
- wizard_uploads:/webroot/storage/app/public # 文件持久化:ml-citation{ref="8" data="citationList"}
ports:
- "8080:80"
networks:
- wizard-net # 加入 MySQL 所在的网络:ml-citation{ref="3,8" data="citationList"}
command: apache2-foreground # 无需迁移命令(数据库已存在):ml-citation{ref="8" data="citationList"}
volumes:
wizard_uploads: # 文件上传目录声明
networks:
wizard-net: # 引用外部网络(需提前存在)
external: true