Update docker-compose安装指南.md

This commit is contained in:
Tamino 2025-01-12 18:52:36 +01:00 committed by GitHub
parent e8d4603eed
commit 0393a91820
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -72,6 +72,103 @@ vi docker-compose.yaml
``` ```
docker compose up -d docker compose up -d
``` ```
# English
## Docker-Compose Deployment Guide
This article guides you on how to quickly deploy **Xboard** using `docker-compose` and SQLite via the command line.
If you prefer using MySQL, you will need to handle the MySQL installation separately.
---
### Deployment (2-Minute Deployment with Docker-Compose)
> Here are the steps to install and quickly experience Xboard.
Deploy your site efficiently using **docker-compose + SQLite** (no need to install MySQL or Redis).
#### 1. Install Docker
```bash
curl -sSL https://get.docker.com | bash
```
For CentOS systems, you may need to execute the following commands to start Docker:
```bash
systemctl enable docker
systemctl start docker
```
#### 2. Download the Docker Compose Files
```bash
git clone -b docker-compose --depth 1 https://github.com/cedar2025/Xboard
cd Xboard
```
#### 3. Run the Database Installation Command
> Enable **SQLite** and **Redis (Docker-Built)**:
```bash
docker compose run -it --rm -e enable_sqlite=true -e enable_redis=true -e admin_account=your_admin_email@example.com xboard php artisan xboard:install
```
Alternatively, customize your preferences at runtime:
```bash
docker compose run -it --rm xboard php artisan xboard:install
```
> After running this command, it will return your admin panel URL, admin account, and password (make sure to record these).
> You need to complete the next step, **Start Xboard**, to access the admin panel.
#### 4. Start Xboard
```bash
docker compose up -d
```
> After installation, your site will be ready for access.
#### 5. Access Your Site
> By default, the website runs on port `7001`. You can configure an NGINX reverse proxy to use port `80`.
Website URL:
`http://your-IP:7001/`
Congratulations! Youve successfully deployed Xboard. You can now visit the URL to explore its full functionality.
> If you need MySQL, please install it separately and redeploy.
---
### **Updating Xboard**
#### 1. Modify the Version
```bash
cd Xboard
vi docker-compose.yaml
```
> Update the version number following `image` in the `docker-compose.yaml` file to your desired version.
> If the version is set to `latest`, you can skip this step and proceed to step 2.
#### 2. Update the Database (Safe to Execute Multiple Times)
```bash
docker compose pull
docker compose down
docker compose run -it --rm xboard php artisan xboard:update
docker compose up -d
```
> The update is now complete.
---
### **Rollback**
> Note: This rollback does not revert the database. Please refer to relevant documentation if a database rollback is required.
#### 1. Revert to a Previous Version
```bash
vi docker-compose.yaml
```
> Update the version number following `image` in the `docker-compose.yaml` file to the previous version.
#### 2. Start the Service
```bash
docker compose up -d
```
---
### Note
Any code modifications made after enabling **webman** require a restart to take effect.
### 注意 ### 注意
启用webman后做的任何代码修改都需要重启生效 启用webman后做的任何代码修改都需要重启生效