Skip to content

Commit

Permalink
发布博客,时间:2024/07/26 10:19:47
Browse files Browse the repository at this point in the history
  • Loading branch information
whp98 committed Jul 26, 2024
1 parent 2475f58 commit 4d84363
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/兴趣/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 兴趣
- [我的世界开服](./我的世界开服/)
- [我对无政府主义的观察和感受](./我对无政府主义的观察和感受.md)
- [Minecraft修改存档允许作弊](./Minecraft修改存档允许作弊.md)
- [手机大猩猩玻璃的代和特点](./手机大猩猩玻璃的代和特点.md)
Expand All @@ -12,7 +13,6 @@
- [软件推荐](./软件推荐.md)
- [网站推荐](./网站推荐.md)
- [少儿编程上手和评价](./少儿编程/少儿编程.md)
- [使用Docker一键开启我的世界服务器[java/基岩]](./我的世界开服/我的世界开服.md)
- [Electron客户端应用程序缺点](./Electron客户端应用程序缺点.md)
- [计算机行业就业分析报告](./计算机行业就业分析报告.md)
- [frp内网穿透后台服务相关](./frp内网穿透后台服务相关.md)
Expand Down
2 changes: 2 additions & 0 deletions docs/兴趣/我的世界开服/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# 我的世界开服
- [我的世界开服-docker-compose](./我的世界开服-docker-compose.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# 我的世界开服-docker-compose

## 配置文件

`docker-compose.yml`

```yaml
services:
web:
image: itzg/rcon
environment:
RWA_USERNAME: admin
RWA_PASSWORD: admin
RWA_ADMIN: "TRUE"
# is referring to the service name 'mc' declared below
RWA_RCON_HOST: mc121
# needs to match the password configured for the container, see RCON_PASSWORD below
RWA_RCON_PASSWORD: "changethis!"
ports:
- "4326:4326"
- "4327:4327"
mc121:
image: itzg/minecraft-server
container_name: mc121
ports:
- "25575:25575"
- "25565:25565"
environment:
VERSION: "1.21"
EULA: "TRUE"
ONLINE_MODE: "FALSE"
MEMORY: "8G"
MODE: "survival"
DIFFICULTY: "normal"
MAX_PLAYERS: "500"
TYPE: SPIGOT
ALLOW_FLIGHT: TRUE
#RCON_CMDS_STARTUP: |-
RCON_PASSWORD: "changethis!"
volumes:
- ./mc121_java:/data
- ./mc121_plugins:/plugins
- ./mc121_mods:/mods
stdin_open: true # equivalent to -it
tty: true # equivalent to -it
restart: unless-stopped
```
## 配置文件解读:
1. 在`docker-compose.yml`文件中,添加一个名为`mc121_java`的容器,并设置其镜像为`itzg/minecraft-server:java`。
2. 为容器设置一些环境变量,如内存限制、游戏模式、难度、最大玩家数等。
3. 为容器挂载一个卷,用于保存游戏数据。

`mc121_java` : 存储游戏数据的卷。

`mc121_plugins`: 存储插件的卷。

`mc121_mods`: 存储模组的卷。

4. 添加一个web rcon控制器,用于控制服务器,里面可以定时执行一些命令来实现个性化管理。


你可以使用`docker-compose up -d`命令来启动容器,使用`docker-compose down`命令来停止容器。

0 comments on commit 4d84363

Please sign in to comment.