Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: updated with example on how to setup lazymc with minecraft container #3017

Merged
merged 2 commits into from
Jul 29, 2024
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: 48 additions & 0 deletions docs/misc/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,54 @@ services:

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

## Lazymc - Put your Minecraft server to rest when idle

With [lazymc-docker-proxy](https://github.com/joesturge/lazymc-docker-proxy) you are able to use [lazymc](https://github.com/timvisee/lazymc) with the minecraft container.

```yaml
services:
lazymc:
container_name: lazymc
image: ghcr.io/joesturge/lazymc-docker-proxy:latest
environment:
# Point to the service name of the Minecraft server
SERVER_ADDRESS: mc:25565
# Required to find the container to manage it
LAZYMC_GROUP: mc
restart: unless-stopped
volumes:
# you should mount the minecraft server dir under /server, using read only.
- data:/server:ro
# you need to supply the docker socket, so that the container can run docker command
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
# lazymc-docker-proxy acts as a proxy, so there is
# no need to expose the server port on the Minecraft container
- "25565:25565"

# Standard Docker Minecraft server, also works with other server types
mc:
image: itzg/minecraft-server:java21
container_name: minecraft-server
# We need to add a label here so that lazymc-docker-proxy knows which
# container to manage
labels:
- lazymc.group=mc
tty: true
stdin_open: true
# This container should be managed solely by the lazymc container
# so set restart to no, or else the container will start again...
restart: no
environment:
EULA: "TRUE"
volumes:
- data:/data

volumes:
data:
```
[Source](https://github.com/joesturge/lazymc-docker-proxy/blob/master/docker-compose.yaml)

## 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.

Expand Down
40 changes: 40 additions & 0 deletions examples/lazymc/docker_compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
services:
lazymc:
container_name: lazymc
image: ghcr.io/joesturge/lazymc-docker-proxy:latest
environment:
# Point to the service name of the Minecraft server
SERVER_ADDRESS: mc:25565
# Required to find the container to manage it
LAZYMC_GROUP: mc
restart: unless-stopped
volumes:
# you should mount the minecraft server dir under /server, using read only.
- data:/server:ro
# you need to supply the docker socket, so that the container can run docker command
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
# lazymc-docker-proxy acts as a proxy, so there is
# no need to expose the server port on the Minecraft container
- "25565:25565"

# Standard Docker Minecraft server, also works with other server types
mc:
image: itzg/minecraft-server:java21
container_name: minecraft-server
# We need to add a label here so that lazymc-docker-proxy knows which
# container to manage
labels:
- lazymc.group=mc
tty: true
stdin_open: true
# This container should be managed solely by the lazymc container
# so set restart to no, or else the container will start again...
restart: no
environment:
EULA: "TRUE"
volumes:
- data:/data

volumes:
data: