From 3bfb55f6eb58efe6f613caac1dc0df714c550216 Mon Sep 17 00:00:00 2001 From: joesturge Date: Sat, 27 Jul 2024 23:19:30 +0100 Subject: [PATCH 1/2] docs: updated with example on how to setup lazymc with minecraft container --- docs/misc/examples.md | 48 ++++++++++++++++++++++++++++++ examples/lazymc/docker_compose.yml | 40 +++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 examples/lazymc/docker_compose.yml diff --git a/docs/misc/examples.md b/docs/misc/examples.md index cc94cabee94..d859e9ce31f 100644 --- a/docs/misc/examples.md +++ b/docs/misc/examples.md @@ -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/settings) 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. diff --git a/examples/lazymc/docker_compose.yml b/examples/lazymc/docker_compose.yml new file mode 100644 index 00000000000..0f4cae34b6d --- /dev/null +++ b/examples/lazymc/docker_compose.yml @@ -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: From d35203ceeede2210f2a0de1c7198ba5cd20c90ed Mon Sep 17 00:00:00 2001 From: joesturge Date: Mon, 29 Jul 2024 20:52:13 +0100 Subject: [PATCH 2/2] docs: fixed link to lazymc-docker-proxy and made docker compose files consistant --- docs/misc/examples.md | 74 +++++++++++++++--------------- examples/lazymc/docker_compose.yml | 4 +- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/docs/misc/examples.md b/docs/misc/examples.md index d859e9ce31f..9d37a8e3409 100644 --- a/docs/misc/examples.md +++ b/docs/misc/examples.md @@ -28,49 +28,49 @@ services: ## Lazymc - Put your Minecraft server to rest when idle -With [lazymc-docker-proxy](https://github.com/joesturge/lazymc-docker-proxy/settings) you are able to use [lazymc](https://github.com/timvisee/lazymc) with the minecraft container. +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" + 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 + # 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: + data: ``` [Source](https://github.com/joesturge/lazymc-docker-proxy/blob/master/docker-compose.yaml) diff --git a/examples/lazymc/docker_compose.yml b/examples/lazymc/docker_compose.yml index 0f4cae34b6d..7d48e6e85df 100644 --- a/examples/lazymc/docker_compose.yml +++ b/examples/lazymc/docker_compose.yml @@ -4,9 +4,9 @@ services: image: ghcr.io/joesturge/lazymc-docker-proxy:latest environment: # Point to the service name of the Minecraft server - - SERVER_ADDRESS=mc:25565 + SERVER_ADDRESS: mc:25565 # Required to find the container to manage it - - LAZYMC_GROUP=mc + LAZYMC_GROUP: mc restart: unless-stopped volumes: # you should mount the minecraft server dir under /server, using read only.