What are you searching for?

Docker Companion

Docker Companion

Server and Docker are best friends now!

download 13 Downloads · favorite 0 Followers · Updated 1 month ago
Fabric Management Neoforge Utility 1.21.1

Versions

inventory_2
1.1.1

1.1.1 · 1 month ago · 9.84 KB

Release download
Neoforge 1.21.1
inventory_2
1.1.1

1.1.1 · 1 month ago · 10.65 KB

Release download
Fabric 1.21.1

About

This mod makes dedicated server more friendly for docker usecases, allowing easily create isolated server setup within seconds without using bloated third-party images and pieces of software.

It can:

  • apply server properties from SERVER_PROPERTIES env varibale
  • auto-op players from SERVER_OPERATORS env varibale
  • handles process signals correctly and gracefully shut-down server process
example Dockerfile

Note, entrypoint must exec java binary in order to handle signals properly and have nice graceful shutdown.

FROM eclipse-temurin:25-jre-alpine-3.23 AS server-build
RUN mkdir /server && apk update && apk add wget
WORKDIR /server
RUN wget -O /installer.jar https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.217/neoforge-21.1.217-installer.jar
RUN java -jar /installer.jar --installServer
RUN echo "eula=true" > eula.txt

FROM eclipse-temurin:25-jre-alpine-3.23
COPY --from=server-build /server /server

RUN cat <<'EOF' > /server/entrypoint.sh
#/usr/bin/env sh
set -e

USER_ID=${USER_ID:-1000}
GROUP_ID=${GROUP_ID:-1000}
USERNAME=${USERNAME:-appuser}

if ! getent group "$GROUP_ID" >/dev/null 2>&1; then
    addgroup -g "$GROUP_ID" "$USERNAME"
fi

if ! id -u "$USER_ID" >/dev/null 2>&1; then
    adduser -D -u "$USER_ID" -G "$USERNAME" -s /bin/bash "$USERNAME"
fi

echo "$SERVER_JAVA_OPTS" > user_jvm_args.txt
chown -R "$USER_ID":"$GROUP_ID" .
exec su-exec "$USERNAME" sh -c 'exec java @user_jvm_args.txt @libraries/net/neoforged/neoforge/21.1.217/unix_args.txt'
EOF

RUN chmod +x /server/entrypoint.sh
RUN apk add --no-cache su-exec
WORKDIR /server
CMD ["/server/entrypoint.sh"]
example docker-compose.yml
services:
  minecraft-server:
    build: ./container
    container_name: minecraft-server
    stdin_open: true
    tty: true
    ports:
      - "25565:25565"
    volumes:
      - ./data/mods:/server/mods
      - ./data/world:/server/world
    environment:
      SERVER_JAVA_OPTS: |2
        -Xms2G
        -Xmx10G
        -XX:+UseZGC
        -XX:+ZGenerational 
        -XX:+AlwaysPreTouch 
        -XX:+UseStringDeduplication
      SERVER_OPERATORS: |2
        op-player-uuid
        another-op-player-uuid
      SERVER_PROPERTIES: |2
        max-players=20
        motd=Welcome to the Minecraft Server!
        online-mode=false
        difficulty=normal
        gamemode=survival
        spawn-monsters=true
        view-distance=10
        white-list=false
        pvp=true
        generate-structures=true
        max-world-size=29999984
        enable-query=false
        enable-rcon=false
        enable-status=false
    restart: unless-stopped
open_in_new View on Modrinth
Compatibility
Client: Unsupported Server: Required
gavel MIT

Conversation

What are your thoughts?

Related projects

Optimization Utility
FerriteCore
FerriteCore

by malte0811

Memory usage optimizations

download 84.3M
favorite 12,712
Utility
Mod Menu
Mod Menu

by Prospector

Adds a mod menu to view the list of mods you have installed.

download 77.7M
favorite 22,127
Library Management Utility
YetAnotherConfigLib (YACL)
YetAnotherConfigLib (YACL)

by isxander

A builder-based configuration library for Minecraft!

download 66.1M
favorite 7,607
Adventure Transportation Utility
Xaero's Minimap
Xaero's Minimap

by thexaero

Displays a map of the nearby world terrain, players, mobs, entities in the corner of your screen. Lets you create waypoints which help you find the locations you've marked.

download 60.9M
favorite 13,668
lock Cookie consent

SkinMC uses cookies to provide functionality and features.