mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-11-21 14:32:39 +00:00
Merge pull request #197 from TheLeftMoose/196-set-server-port
Fixes #196 makes it possible to add server port as a env.
This commit is contained in:
3 files changed
+7
-1
No files matched your search
@@ -46,4 +46,4 @@ ENV UID=1000 GID=1000 \
|
|||||||
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
||||||
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= LEVEL=world \
|
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= LEVEL=world \
|
||||||
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||||
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= ONLINE_MODE=TRUE CONSOLE=true
|
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true
|
||||||
@@ -456,6 +456,11 @@ this server instance.
|
|||||||
|
|
||||||
## Server configuration
|
## Server configuration
|
||||||
|
|
||||||
|
### Server port
|
||||||
|
|
||||||
|
The server port can be set like:
|
||||||
|
docker run -d -e SERVER_PORT=25565 ...
|
||||||
|
|
||||||
### Difficulty
|
### Difficulty
|
||||||
|
|
||||||
The difficulty level (default: `easy`) can be set like:
|
The difficulty level (default: `easy`) can be set like:
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ if [ ! -e $SERVER_PROPERTIES ]; then
|
|||||||
setServerProp "white-list" "true"
|
setServerProp "white-list" "true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
setServerProp "server-port" "$SERVER_PORT"
|
||||||
setServerProp "motd" "$MOTD"
|
setServerProp "motd" "$MOTD"
|
||||||
setServerProp "allow-nether" "$ALLOW_NETHER"
|
setServerProp "allow-nether" "$ALLOW_NETHER"
|
||||||
setServerProp "announce-player-achievements" "$ANNOUNCE_PLAYER_ACHIEVEMENTS"
|
setServerProp "announce-player-achievements" "$ANNOUNCE_PLAYER_ACHIEVEMENTS"
|
||||||
|
|||||||
Reference in new issue
Block a user