docker-minecraft-server icon indicating copy to clipboard operation
docker-minecraft-server copied to clipboard

Option to use lazymc

Open savdbroek opened this issue 1 year ago • 3 comments

Enhancement Type

A completely new feature

Describe the enhancement

It would be great if this docker image could have lazymc as an option.

https://github.com/timvisee/lazymc

savdbroek avatar Jan 01 '24 11:01 savdbroek

Conceptually that's a good idea and was also brought up here

https://github.com/itzg/docker-minecraft-server/issues/2115#issuecomment-1542810309

It would be difficult to retrofit that into the existing design, but will park it here in case I can think about it more.

itzg avatar Jan 01 '24 15:01 itzg

I have something similar running with lazy_container.

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
      - 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
      - MOTD=From_9_till_22
      - 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: {}

nfroeschl avatar Jan 16 '24 10:01 nfroeschl

@nfroeschl that would be a great section for https://github.com/itzg/docker-minecraft-server/blob/master/docs/misc/examples.md if you want to PR that.

itzg avatar Jan 16 '24 13:01 itzg

Hello @savdbroek and @itzg, I know this issue is closed but I have found a way to get lazymc to work with the container, similar to how lazytainer works. Instead of wrapping the server jar in the lazytainer jar, you can pass a custom run command to lazymc, I leveraged this to execute docker start on the minecraft server container. It operated completely seperatly to the minecraft container, in a very similar way to lazytainer. It took a bit of fanageling to work but it works, and quite well.

See it here: https://github.com/joesturge/lazymc-docker-proxy

perhaps, we could ship an image like this to work alongside the itzg container? Let me know what you think

joesturge avatar Jul 22 '24 21:07 joesturge

@joesturge very cool. By all means go ahead and get that image going. You can PR a section in the examples along with the lazytainer approach.

itzg avatar Jul 22 '24 21:07 itzg

@itzg https://github.com/itzg/docker-minecraft-server/pull/3017

joesturge avatar Jul 27 '24 22:07 joesturge