Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 47 additions & 1 deletion docs/misc/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,50 @@ services:
- ./data:/data
```

[Source](https://github.com/itzg/docker-minecraft-server/blob/master/examples/geyser/docker-compose.yml)
[Source](https://github.com/itzg/docker-minecraft-server/blob/master/examples/geyser/docker-compose.yml)

## Lazytainer - Stop Minecraft container based on traffic
Monitors network traffic to the Minecraft containers. If there is traffic, the container runs, otherwise the container is stopped/paused.

By using [Lazytainer](https://github.com/vmorganp/Lazytainer) with the [docker-minecraft-server](https://github.com/itzg/docker-minecraft-server) a somehow similar behaviour to [Lazymc](https://github.com/timvisee/lazymc) can be archived.

```yaml
version: "3"
services:
lazytainer:
container_name: lazytainer
image: ghcr.io/vmorganp/lazytainer:master
environment:
- VERBOSE=false
ports:
- 25565:25565
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:
- lazytainer.group.minecraft.sleepMethod=stop
- lazytainer.group.minecraft.ports=25565
- lazytainer.group.minecraft.minPacketThreshold=2 # Start after two incomming packets
- lazytainer.group.minecraft.inactiveTimeout=600 # 10 minutes, to allow the server to bootstrap. You can probably make this lower later if you want.
restart: unless-stopped
network_mode: bridge
mc:
image: itzg/minecraft-server
environment:
- EULA=TRUE
- TYPE=PURPUR
- MEMORY=4G
- TZ=Europe/Berlin
- OVERRIDE_SERVER_PROPERTIES=TRUE
volumes:
- /opt/container_volumes/minecraft/data:/data
labels:
- lazytainer.group=minecraft
depends_on:
- lazytainer
network_mode: service:lazytainer
tty: true
stdin_open: true
restart: unless-stopped
networks: {}
```
[Source](https://github.com/itzg/docker-minecraft-server/blob/master/examples/lazytainer/docker-compose.yml)
37 changes: 37 additions & 0 deletions examples/lazytainer/docker_compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: "3"
services:
lazytainer:
container_name: lazytainer
image: ghcr.io/vmorganp/lazytainer:master
environment:
- VERBOSE=false
ports:
- 25565:25565
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:
- lazytainer.group.minecraft.sleepMethod=stop
- lazytainer.group.minecraft.ports=25565
- lazytainer.group.minecraft.minPacketThreshold=2 # Start after two incomming packets
- lazytainer.group.minecraft.inactiveTimeout=600 # 10 minutes, to allow the server to bootstrap. You can probably make this lower later if you want.
restart: unless-stopped
network_mode: bridge
mc:
image: itzg/minecraft-server
environment:
- EULA=TRUE
- TYPE=PURPUR
- MEMORY=4G
- TZ=Europe/Berlin
- OVERRIDE_SERVER_PROPERTIES=TRUE
volumes:
- /opt/container_volumes/minecraft/data:/data
labels:
- lazytainer.group=minecraft
depends_on:
- lazytainer
network_mode: service:lazytainer
tty: true
stdin_open: true
restart: unless-stopped
networks: {}