mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
mc: apply INIT/MAX RAM settings into FTB local settings file
fixes #222
This commit is contained in:
parent
2a1fba1b45
commit
a95bfdb192
16
minecraft-server/examples/docker-compose-ftb.yml
Normal file
16
minecraft-server/examples/docker-compose-ftb.yml
Normal file
@ -0,0 +1,16 @@
|
||||
version: '3.2'
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: FTB
|
||||
FTB_SERVER_MOD: https://www.feed-the-beast.com/projects/ftb-presents-skyfactory-3/files/2481284
|
||||
ports:
|
||||
- 25565:25565
|
||||
volumes:
|
||||
- mc-ftb:/data
|
||||
|
||||
volumes:
|
||||
mc-ftb:
|
@ -73,8 +73,7 @@ if [[ ${GUI} = false || ${GUI} = FALSE ]]; then
|
||||
fi
|
||||
|
||||
# put these prior JVM_OPTS at the end to give any memory settings there higher precedence
|
||||
echo "Setting initial memory to ${INIT_MEMORY:-${MEMORY}} and max to ${MAX_MEMORY:-${MEMORY}}"
|
||||
JVM_OPTS="-Xms${INIT_MEMORY:-${MEMORY}} -Xmx${MAX_MEMORY:-${MEMORY}} ${JVM_OPTS}"
|
||||
echo "Setting initial memory to ${INIT_MEMORY:=${MEMORY}} and max to ${MAX_MEMORY:=${MEMORY}}"
|
||||
|
||||
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||
if [ ! -e ${FTB_DIR}/ops.json -a -e /data/ops.txt ]; then
|
||||
@ -89,14 +88,20 @@ if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||
cp -f /data/eula.txt ${FTB_DIR}/
|
||||
fi
|
||||
|
||||
cat > ${FTB_DIR}/settings-local.sh <<EOF
|
||||
export MIN_RAM="${INIT_MEMORY}"
|
||||
export MAX_RAM="${MAX_MEMORY}"
|
||||
EOF
|
||||
|
||||
cd ${FTB_DIR}
|
||||
echo "Running FTB server modpack start ..."
|
||||
exec mc-server-runner ${FTB_SERVER_START}
|
||||
else
|
||||
# If we have a bootstrap.txt file... feed that in to the server stdin
|
||||
if [ -f /data/bootstrap.txt ]; then
|
||||
bootstrapArgs="--bootstrap /data/bootstrap.txt"
|
||||
fi
|
||||
# If we have a bootstrap.txt file... feed that in to the server stdin
|
||||
if [ -f /data/bootstrap.txt ]; then
|
||||
bootstrapArgs="--bootstrap /data/bootstrap.txt"
|
||||
fi
|
||||
|
||||
exec mc-server-runner ${bootstrapArgs} java $JVM_XX_OPTS $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS
|
||||
JVM_OPTS="-Xms${INIT_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}"
|
||||
exec mc-server-runner ${bootstrapArgs} java $JVM_XX_OPTS $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user