Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b2bb150aa |
@@ -134,6 +134,31 @@ docker run -d --name moyu-qile --restart unless-stopped \
|
||||
|
||||
> **数据卷必须挂**:存档(`*-saves.json`)、战绩(`*-ranks.json`)与路径配置都在 `/app/data`,不挂卷重建容器会丢。
|
||||
|
||||
### 方式二:Docker Compose部署
|
||||
|
||||
仓库里没有现成的 `docker-compose.yml`,下面这份是按 `Dockerfile`(端口 7025、数据目录 `/app/data`)写的**最小可用** yaml,与方式 1 的 `docker run` 等价:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
moyu-qile:
|
||||
build: .
|
||||
image: moyu-qile:latest
|
||||
container_name: moyu-qile
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "7025:7025"
|
||||
volumes:
|
||||
# 存档 *-saves.json、战绩 *-ranks.json 与路径配置都在这里,必须挂载
|
||||
- ./data:/app/data
|
||||
environment:
|
||||
- PORT=7025
|
||||
```
|
||||
|
||||
```bash
|
||||
docker compose up -d --build # 首次构建并启动
|
||||
docker compose up -d # 日常更新 / 重启
|
||||
```
|
||||
|
||||
### 本地直跑(不用 Docker)
|
||||
|
||||
```bash
|
||||
|
||||
Reference in new issue
Block a user