2020-12-31 11:46:00 +01:00
|
|
|
<!---
|
|
|
|
|
|
|
|
Copyright (C) 2020 Jef Roosens
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
2020-12-30 16:43:58 +01:00
|
|
|
# Build arguments
|
|
|
|
Only one build argument is required, namely `FABRIC_VERSION`. This is the
|
|
|
|
version of Fabric you wish to install. You can find the list of versions
|
|
|
|
[here](https://fabricmc.net/use/). For example, you can then set
|
|
|
|
`FABRIC_VERSION=0.6.1.51` in the `.env` file.
|
2020-12-30 12:24:21 +01:00
|
|
|
|
2020-12-30 16:43:58 +01:00
|
|
|
# Environment variables
|
|
|
|
The two possible environment variables are `XMS` and `XMX`. These specify the
|
2020-12-30 16:59:05 +01:00
|
|
|
initial RAM & maximum RAM usage respectively. Only `XMS` is required; `XMX` is
|
2020-12-30 16:43:58 +01:00
|
|
|
just set to the same value as `XMS` if not specified. You must specify them as
|
|
|
|
a number, e.g. `XMS=4`. This number represents a quantity of gigabytes.
|
2020-12-30 12:24:21 +01:00
|
|
|
|
2020-12-30 16:43:58 +01:00
|
|
|
# Mount points
|
|
|
|
There a three useful mount points defined:
|
2020-12-30 12:24:21 +01:00
|
|
|
|
|
|
|
* `/mc/config`: this is where all server config files reside.
|
|
|
|
* `/mc/config/mods`: this is where all mods should be placed.
|
|
|
|
* `/mc/worlds`: this is where the world files are stored.
|
|
|
|
|
2020-12-30 16:43:58 +01:00
|
|
|
You can mount these directories somewhere in the host file system by specifying
|
|
|
|
the mount paths in the `.env` file. These can be both absolute or relative
|
|
|
|
paths.
|
2020-12-30 12:24:21 +01:00
|
|
|
|
2020-12-30 16:43:58 +01:00
|
|
|
# Other config variables
|
|
|
|
The only other config variable is `PORT`. This specifies on what port your
|
|
|
|
server will be discoverable over the internet. The default Minecraft port is
|
|
|
|
`25565`.
|
2020-12-30 12:24:21 +01:00
|
|
|
|
2020-12-30 16:43:58 +01:00
|
|
|
# Java flags
|
2020-12-30 12:24:21 +01:00
|
|
|
I use the Java flags defined
|
|
|
|
[here](https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/).
|
|
|
|
If you don't agree with this decision, you can change the `ENTRYPOINT` at the
|
|
|
|
end of the `Dockerfile` to the following:
|
|
|
|
|
|
|
|
```
|
|
|
|
ENTRYPOINT java \
|
|
|
|
-Xms"${XMS}G" \
|
|
|
|
-Xmx"${XMX:-$XMS}G" \
|
|
|
|
-jar fabric-server-launch.jar \
|
|
|
|
--universe /mc/worlds \
|
|
|
|
--nogui
|
|
|
|
```
|
|
|
|
|
|
|
|
This will only use the flags absolutely necessary, while still allowing you to
|
|
|
|
tweak the memory variables.
|