mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 07:03:57 +00:00
Compare commits
32 Commits
2026.1.3
...
f502acfbff
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f502acfbff | ||
|
|
d217e21903 | ||
|
|
dd5e2be036 | ||
|
|
b818a72e54 | ||
|
|
fe1cadcb0d | ||
|
|
ac125dc15e | ||
|
|
4c0fd104c6 | ||
|
|
cca86e6a3d | ||
|
|
67ec9e1b3c | ||
|
|
5847c54c8f | ||
|
|
796849f9d8 | ||
|
|
6e05807865 | ||
|
|
fbbe29507e | ||
|
|
2bcc7d81bf | ||
|
|
41e50d3e9f | ||
|
|
6bb401f9ff | ||
|
|
82266fff97 | ||
|
|
92b4babc86 | ||
|
|
83435738f4 | ||
|
|
a9dd219f78 | ||
|
|
90ac9589e3 | ||
|
|
9520b06095 | ||
|
|
1ae5e4d748 | ||
|
|
d43802ebd4 | ||
|
|
4677d9065d | ||
|
|
4f6de31e38 | ||
|
|
941e25c4b9 | ||
|
|
621c673acd | ||
|
|
fb1614b149 | ||
|
|
feec7fb6bd | ||
|
|
f27eb08440 | ||
|
|
183e0cd18f |
37
.github/workflows/build.yml
vendored
37
.github/workflows/build.yml
vendored
@@ -12,7 +12,12 @@ on:
|
||||
- "examples/**"
|
||||
- "notes/**"
|
||||
- "kustomize/**"
|
||||
- "docker-compose.yml"
|
||||
- "images.json"
|
||||
- "compose-docs.yml"
|
||||
- "zensical.toml"
|
||||
- ".readthedocs.yaml"
|
||||
- "renovate.json5"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -23,17 +28,13 @@ jobs:
|
||||
variant:
|
||||
- java25
|
||||
- java25-jdk
|
||||
- java25-graalvm
|
||||
- java21
|
||||
- java21-alpine
|
||||
- java21-graalvm
|
||||
- java21-jdk
|
||||
- java17
|
||||
- java17-graalvm
|
||||
- java16
|
||||
- java11
|
||||
- java8
|
||||
- java8-graalvm-ce
|
||||
- java8-jdk
|
||||
include:
|
||||
# JAVA 25
|
||||
@@ -45,15 +46,7 @@ jobs:
|
||||
baseImage: eclipse-temurin:25
|
||||
platforms: linux/amd64,linux/arm64
|
||||
mcVersion: latest
|
||||
- variant: java25-graalvm
|
||||
baseImage: container-registry.oracle.com/graalvm/jdk:25-ol10
|
||||
platforms: linux/amd64,linux/arm64
|
||||
mcVersion: latest
|
||||
# JAVA 21:
|
||||
- variant: java21-graalvm
|
||||
baseImage: container-registry.oracle.com/graalvm/jdk:21-ol10
|
||||
platforms: linux/amd64,linux/arm64
|
||||
mcVersion: latest
|
||||
- variant: java21
|
||||
baseImage: eclipse-temurin:21-jre
|
||||
platforms: linux/amd64,linux/arm64
|
||||
@@ -72,10 +65,6 @@ jobs:
|
||||
baseImage: eclipse-temurin:17-jre-focal
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
mcVersion: 1.20.4
|
||||
- variant: java17-graalvm
|
||||
baseImage: container-registry.oracle.com/graalvm/jdk:17-ol10
|
||||
platforms: linux/amd64,linux/arm64
|
||||
mcVersion: 1.20.4
|
||||
# JAVA 16
|
||||
- variant: java16
|
||||
baseImage: adoptopenjdk:16-jre-hotspot
|
||||
@@ -93,12 +82,6 @@ jobs:
|
||||
mcVersion: 1.12.2
|
||||
# Pin version for Java 8
|
||||
mcHelperVersion: 1.51.1
|
||||
- variant: java8-graalvm-ce
|
||||
baseImage: ghcr.io/graalvm/graalvm-ce:java8
|
||||
platforms: linux/amd64
|
||||
mcVersion: 1.12.2
|
||||
# Pin version for Java 8
|
||||
mcHelperVersion: 1.51.1
|
||||
- variant: java8-jdk
|
||||
baseImage: eclipse-temurin:8u312-b07-jdk-focal
|
||||
platforms: linux/amd64,linux/arm64
|
||||
@@ -112,7 +95,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6.0.1
|
||||
uses: actions/checkout@v6.0.2
|
||||
with:
|
||||
# for build-files step
|
||||
fetch-depth: 0
|
||||
@@ -155,7 +138,7 @@ jobs:
|
||||
uses: docker/setup-qemu-action@v3.7.0
|
||||
|
||||
- name: Build for test
|
||||
uses: docker/build-push-action@v6.18.0
|
||||
uses: docker/build-push-action@v6.19.2
|
||||
with:
|
||||
platforms: linux/amd64
|
||||
tags: ${{ env.IMAGE_TO_TEST }}
|
||||
@@ -180,14 +163,14 @@ jobs:
|
||||
tests/test.sh
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3.6.0
|
||||
uses: docker/login-action@v3.7.0
|
||||
if: env.HAS_IMAGE_REPO_ACCESS
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3.6.0
|
||||
uses: docker/login-action@v3.7.0
|
||||
if: env.HAS_IMAGE_REPO_ACCESS
|
||||
with:
|
||||
registry: ghcr.io
|
||||
@@ -195,7 +178,7 @@ jobs:
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6.18.0
|
||||
uses: docker/build-push-action@v6.19.2
|
||||
if: github.actor == github.repository_owner
|
||||
with:
|
||||
platforms: ${{ matrix.platforms }}
|
||||
|
||||
13
.github/workflows/verify-pr.yml
vendored
13
.github/workflows/verify-pr.yml
vendored
@@ -9,9 +9,12 @@ on:
|
||||
- "examples/**"
|
||||
- "notes/**"
|
||||
- "kustomize/**"
|
||||
- "docker-compose*.yml"
|
||||
- "mkdocs.yml"
|
||||
- "docker-compose.yml"
|
||||
- "images.json"
|
||||
- "compose-docs.yml"
|
||||
- "zensical.toml"
|
||||
- ".readthedocs.yaml"
|
||||
- "renovate.json5"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -50,7 +53,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6.0.1
|
||||
uses: actions/checkout@v6.0.2
|
||||
with:
|
||||
# for build-files step
|
||||
fetch-depth: 0
|
||||
@@ -59,7 +62,7 @@ jobs:
|
||||
uses: docker/setup-buildx-action@v3.12.0
|
||||
|
||||
- name: Confirm multi-arch build
|
||||
uses: docker/build-push-action@v6.18.0
|
||||
uses: docker/build-push-action@v6.19.2
|
||||
with:
|
||||
platforms: ${{ matrix.platforms }}
|
||||
# ensure latest base image is used
|
||||
@@ -70,7 +73,7 @@ jobs:
|
||||
cache-from: type=gha,scope=${{ matrix.variant }}
|
||||
|
||||
- name: Build for test
|
||||
uses: docker/build-push-action@v6.18.0
|
||||
uses: docker/build-push-action@v6.19.2
|
||||
with:
|
||||
# Only build single platform since loading multi-arch image into daemon fails with
|
||||
# "docker exporter does not currently support exporting manifest lists"
|
||||
|
||||
@@ -49,7 +49,8 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \
|
||||
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
ARG MC_HELPER_VERSION=1.52.1
|
||||
# renovate: datasource=github-releases packageName=itzg/mc-image-helper versioning=loose
|
||||
ARG MC_HELPER_VERSION=1.54.0
|
||||
ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
|
||||
# used for cache busting local copy of mc-image-helper
|
||||
ARG MC_HELPER_REV=1
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
[](https://hub.docker.com/r/itzg/minecraft-server/)
|
||||
[](https://github.com/itzg/docker-minecraft-server/issues)
|
||||
[](https://discord.gg/DXfKpjB)
|
||||
[](https://github.com/itzg/docker-minecraft-server/actions/workflows/build-multiarch.yml)
|
||||
[](https://github.com/itzg/docker-minecraft-server/actions/workflows/build.yml)
|
||||
[](https://www.buymeacoffee.com/itzg)
|
||||
[](https://docker-minecraft-server.readthedocs.io/en/latest/?badge=latest)
|
||||
|
||||
|
||||
@@ -64,12 +64,16 @@ fi
|
||||
# Clean up DNF when done
|
||||
dnf clean all
|
||||
|
||||
# Download and install patched knockd
|
||||
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz
|
||||
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
|
||||
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
|
||||
ls -l /usr/local/sbin/knockd
|
||||
setcap cap_net_raw=ep /usr/local/sbin/knockd
|
||||
cat <<EOF > /usr/local/sbin/knockd
|
||||
#!/bin/sh
|
||||
|
||||
echo "Auto-pause (using knockd) is currently unavailable on graalvm image variants"
|
||||
echo "Consider using a different image variant https://docker-minecraft-server.readthedocs.io/en/latest/versions/java/"
|
||||
echo "or mc-router's auto scale up/down feature https://github.com/itzg/mc-router#docker-auto-scale-updown"
|
||||
exit 2
|
||||
EOF
|
||||
chmod 755 /usr/local/sbin/knockd
|
||||
# TODO restore retrieval from https://github.com/Metalcape/knock when tar's "Cannot open: Invalid argument" is solved
|
||||
|
||||
# Set git credentials globally
|
||||
cat <<EOF >> /etc/gitconfig
|
||||
|
||||
15
compose-dev.yml
Normal file
15
compose-dev.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
services:
|
||||
mc-dev:
|
||||
build:
|
||||
context: .
|
||||
environment:
|
||||
EULA: true
|
||||
volumes:
|
||||
- ./scripts:/image/scripts:ro
|
||||
- data:/data
|
||||
ports:
|
||||
- "25565:25565"
|
||||
stdin_open: true
|
||||
tty: true
|
||||
volumes:
|
||||
data:
|
||||
@@ -11,61 +11,15 @@ Adding a new server `TYPE` can vary due to the complexity of obtaining and confi
|
||||
|
||||
## Iterative script development
|
||||
|
||||
Individual scripts can be iteratively developed, debugged, and tested using the following procedure.
|
||||
|
||||
First, build a baseline of the image to include the packages needed by existing or new scripts:
|
||||
|
||||
PowerShell: (Example of building and testing ForgeAPI)
|
||||
```powershell
|
||||
$env:FOLDER_TO_TEST="forgeapimods_projectids"
|
||||
$env:IMAGE_TO_TEST="mc-dev"
|
||||
docker build -t $env:IMAGE_TO_TEST .
|
||||
pushd "tests/setuponlytests/$env:FOLDER_TO_TEST/"
|
||||
docker compose run mc
|
||||
docker compose down -v --remove-orphans
|
||||
popd
|
||||
```
|
||||
|
||||
PowerShell: Building different images of Java for testing
|
||||
```powershell
|
||||
$env:BASE_IMAGE='eclipse-temurin:8u312-b07-jre'
|
||||
$env:IMAGE_TO_TEST="mc-dev"
|
||||
docker build --build-arg BASE_IMAGE=$env:BASE_IMAGE -t $env:IMAGE_TO_TEST .
|
||||
```
|
||||
|
||||
Bash: (Example of building and testing ForgeAPI)
|
||||
```bash
|
||||
export FOLDER_TO_TEST="forgeapimods_file"
|
||||
export IMAGE_TO_TEST="mc-dev"
|
||||
docker build -t $IMAGE_TO_TEST .
|
||||
pushd tests/setuponlytests/$FOLDER_TO_TEST/
|
||||
docker compose run mc
|
||||
docker compose down -v --remove-orphans
|
||||
popd
|
||||
```
|
||||
|
||||
Using the baseline image, an interactive container can be started to iteratively run the scripts to be developed. By attaching the current workspace directory, you can use the local editor of your choice to iteratively modify scripts while using the container to run them.
|
||||
The included `compose-dev.yml` will mount the local `scripts` code into the container and allow for iterative development. Replace `[-e key=value]` with any environment variables you wish to set for testing the modified scripts.
|
||||
|
||||
```shell
|
||||
docker run -it --rm -v ${PWD}:/image/scripts --entrypoint bash mc-dev
|
||||
docker compose -f compose-dev.yml run --rm -it [-e key=value] mc-dev
|
||||
```
|
||||
|
||||
From within the container you can run individual scripts via the attached `/image/scripts/` path; however, be sure to set any environment variables expected by the scripts by either `export`ing them manually:
|
||||
!!! tip
|
||||
|
||||
```shell
|
||||
export VERSION=1.12.2
|
||||
/image/scripts/start-deployFabric
|
||||
```
|
||||
|
||||
...or pre-pending script execution:
|
||||
|
||||
```shell
|
||||
VERSION=1.12.2 /image/scripts/start-deployFabric
|
||||
```
|
||||
|
||||
!!! note
|
||||
|
||||
You may want to temporarily add an `exit` statement near the end of your script to isolate execution to just the script you're developing.
|
||||
To speed up the development cycle, it is recommended to set `SETUP_ONLY` to `true` as part of the run command above.
|
||||
|
||||
## Using development copy of tools
|
||||
|
||||
|
||||
@@ -2,21 +2,21 @@ click==8.3.1
|
||||
colorama==0.4.6
|
||||
deepmerge==2.0
|
||||
ghp-import==2.1.0
|
||||
griffe==1.15.0
|
||||
griffe==2.0.0
|
||||
Jinja2==3.1.6
|
||||
Markdown==3.10
|
||||
Markdown==3.10.2
|
||||
MarkupSafe==3.0.3
|
||||
mergedeep==1.3.4
|
||||
mkdocs==1.6.1
|
||||
mkdocs-autorefs==1.4.3
|
||||
mkdocs-autorefs==1.4.4
|
||||
mkdocs-get-deps==0.2.0
|
||||
mkdocstrings==1.0.0
|
||||
mkdocstrings-python==2.0.1
|
||||
packaging==25.0
|
||||
pathspec==1.0.3
|
||||
platformdirs==4.5.1
|
||||
mkdocstrings==1.0.3
|
||||
mkdocstrings-python==2.0.2
|
||||
packaging==26.0
|
||||
pathspec==1.0.4
|
||||
platformdirs==4.9.2
|
||||
Pygments==2.19.2
|
||||
pymdown-extensions==10.20
|
||||
pymdown-extensions==10.21
|
||||
python-dateutil==2.9.0.post0
|
||||
PyYAML==6.0.3
|
||||
pyyaml_env_tag==1.1
|
||||
|
||||
@@ -41,6 +41,8 @@ A specific loader or launcher version other than the latest can be requested usi
|
||||
FABRIC_LOADER_VERSION: 0.13.1
|
||||
```
|
||||
|
||||
The container fetches Fabric loader and game version metadata from the [Fabric meta API](https://meta.fabricmc.net). You can override the base URL with `FABRIC_META_BASE_URL` (default: `https://meta.fabricmc.net`), for example when using a mirror or custom meta endpoint.
|
||||
|
||||
!!! note
|
||||
|
||||
See the [Working with mods and plugins](../../mods-and-plugins/index.md) section to set up Fabric mods and configuration.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
A [PaperMC server](https://papermc.io/) can be automatically downloaded, upgraded, and run by setting the environment variable TYPE to "PAPER".
|
||||
|
||||
By default, the container will find and download the latest build for the `VERSION` chosen. If `VERSION` is not specified, then the latest Minecraft version released by PaperMC is selected. Along with a specific `VERSION`, a specific Paper build can be selected by setting the environment variable `PAPER_BUILD`.
|
||||
By default, the container will find and download the latest build for the `VERSION` chosen. If `VERSION` is not specified, then the latest Minecraft version released by PaperMC is selected. Along with a specific `VERSION`, a specific Paper build can be selected by setting the environment variable `PAPER_BUILD`.
|
||||
|
||||
To allow for the selection of experimental builds, set `PAPER_CHANNEL` to "experimental", otherwise only release/default channel builds are selected.
|
||||
|
||||
@@ -65,6 +65,7 @@ A [Pufferfish](https://github.com/pufferfish-gg/Pufferfish) server, which is "a
|
||||
The `VERSION` variable is used to select branch latest, 1.18, or 1.17. Use PUFFERFISH_BUILD to really select the SERVER VERSION number.
|
||||
|
||||
Extra variables:
|
||||
|
||||
- `PUFFERFISH_BUILD=lastSuccessfulBuild` : set a specific Pufferfish build to use. Example: selecting build 47 => 1.18.1, or build 50 => 1.18.2 etc
|
||||
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
||||
- `USE_FLARE_FLAGS=false` : set to true to add appropriate flags for the built-in [Flare](https://blog.airplane.gg/flare) profiler
|
||||
@@ -80,6 +81,7 @@ A [Purpur](https://purpurmc.org/) server, which is "a drop-in replacement for Pa
|
||||
The `VERSION` variable is used to lookup a build of Purpur to download
|
||||
|
||||
Extra variables:
|
||||
|
||||
- `PURPUR_BUILD=LATEST` : set a specific Purpur build to use
|
||||
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
||||
- `USE_FLARE_FLAGS=false` : set to true to add appropriate flags for the built-in [Flare](https://blog.airplane.gg/flare) profiler
|
||||
@@ -129,4 +131,23 @@ If you have attached a host directory to the `/data` volume, then you can instal
|
||||
|
||||
## Extra config
|
||||
|
||||
- `SKIP_DOWNLOAD_DEFAULTS`: when set to "true" startup will entirely skip checking for default Paper/Bukkit/Spigot config files to download
|
||||
- `SKIP_DOWNLOAD_DEFAULTS`: when set to "true" startup will entirely skip checking for default Paper/Bukkit/Spigot config files to download
|
||||
|
||||
## Configuration Repositories
|
||||
|
||||
You can automatically download optimized or custom configuration files (e.g., `bukkit.yml`, `spigot.yml`, `paper-global.yml`, `purpur.yml`) by setting a repository URL. The container will automatically append the Minecraft version to the URL (e.g., `<REPO_URL>/1.21.1/<FILE>`).
|
||||
|
||||
| Server Type | Variable |
|
||||
| :--- | :--- |
|
||||
| Paper | `PAPER_CONFIG_REPO` |
|
||||
| Pufferfish | `PUFFERFISH_CONFIG_REPO` |
|
||||
| Purpur | `PURPUR_CONFIG_REPO` |
|
||||
|
||||
### Server Properties
|
||||
|
||||
You can also download a base `server.properties` file using `SERVER_PROPERTIES_REPO_URL`.
|
||||
|
||||
- **Smart Mode**: If the URL does **not** end in `.properties`, the script treats it as a base URL and appends `/${VERSION}/server.properties` (matching the behavior of the config repos).
|
||||
- **Direct Mode**: If the URL ends in `.properties`, it downloads that specific file.
|
||||
|
||||
**Note**: Environment variables (like `MOTD`, `DIFFICULTY`, `MAX_PLAYERS`) defined in your Docker configuration will **override** values in the downloaded `server.properties` file.
|
||||
|
||||
@@ -230,13 +230,13 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>LEVEL</code></td>
|
||||
<td>Maps to [the `level-name` server property](https://minecraft.wiki/w/Server.properties#level-name). You can either switch between world saves or run multiple containers with different saves by using the LEVEL option</td>
|
||||
<td>Maps to <a href="https://minecraft.wiki/w/Server.properties#level-name">the <code>level-name</code> server property</a>. You can either switch between world saves or run multiple containers with different saves by using the LEVEL option</td>
|
||||
<td><code>world</code></td>
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>SERVER_PORT</code></td>
|
||||
<td>Maps to [the `server-port` server property](https://minecraft.wiki/w/Server.properties#server-port). Only change this value if you know what you're doing. It is only needed when using host networking and it is rare that host networking should be used.</td>
|
||||
<td>Maps to <a href="https://minecraft.wiki/w/Server.properties#server-port">the <code>server-port</code> server property</a>. Only change this value if you know what you're doing. It is only needed when using host networking and it is rare that host networking should be used.</td>
|
||||
<td><code></code></td>
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
# A Form to Load New Config Files to Paper MC
|
||||
|
||||
In this example, we illustrate how to efficiently load and manage different configuration files to optimize a Paper Minecraft server. To implement this, it is necessary to create a dedicated repository where the configuration files can be stored and later retrieved. The repository should adhere to a specific structure to facilitate seamless integration with your Docker setup. Notably, the configurations must be organized into a folder named after the version of Minecraft you are using.
|
||||
|
||||
For reference, I have provided this [repository](https://github.com/Alpha018/paper-config-optimized), which contains optimized configuration files for the latest version of Minecraft. You can use this repository by linking directly to the configuration files in your Docker file, as demonstrated in the example below.
|
||||
|
||||
## Usage
|
||||
|
||||
You can directly use the optimized configuration files from this repository by accessing them through the GitHub raw URLs. Simply replace the env var like the docker compose with any other repo with different configurations.
|
||||
|
||||
To use the raw files, you can download or link to them using the following pattern:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
container_name: paper
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: "PAPER"
|
||||
VIEW_DISTANCE: 10
|
||||
MEMORY: 2G
|
||||
PAPER_CONFIG_REPO: "https://raw.githubusercontent.com/[your-username]/[your-repository]/main/[file-path]"
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- mc-paper:/data
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
mc-paper: {}
|
||||
```
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
container_name: paper
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: "PAPER"
|
||||
VIEW_DISTANCE: 10
|
||||
MEMORY: 2G
|
||||
PAPER_CONFIG_REPO: "https://raw.githubusercontent.com/Alpha018/paper-config-optimized/main"
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- mc-paper:/data
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
mc-paper: {}
|
||||
```
|
||||
|
||||
Feel free to explore and use the configurations in this repo to enhance your Minecraft server's performance.
|
||||
|
||||
## Contribution
|
||||
|
||||
If you'd like to improve or suggest changes to these configurations, feel free to submit a pull request in this [repository](https://github.com/Alpha018/paper-config-optimized). We welcome contributions from the community!
|
||||
|
||||
129
examples/optimized-server-config/README.md
Normal file
129
examples/optimized-server-config/README.md
Normal file
@@ -0,0 +1,129 @@
|
||||
# Optimized Server Configuration (Paper, Purpur, Pufferfish)
|
||||
|
||||
This example demonstrates how to automatically download and apply optimized configuration files for your Minecraft server from a remote Git repository. This is useful for maintaining a standard, high-performance configuration across multiple server instances.
|
||||
|
||||
## Features
|
||||
|
||||
- **Automatic Download**: Fetches `bukkit.yml`, `spigot.yml`, and server-specific configs (`paper-global.yml`, `purpur.yml`, `pufferfish.yml`) on startup.
|
||||
- **Version Aware**: Downloads configurations from a folder matching your Minecraft version (e.g., `1.21.1`).
|
||||
- **Base `server.properties`**: Optionally download a base `server.properties` file while still allowing environment variable overrides.
|
||||
|
||||
## Repository Structure
|
||||
|
||||
Your configuration repository should be structured by Minecraft version. For example:
|
||||
|
||||
```text
|
||||
my-config-repo/
|
||||
├── 1.21.1/
|
||||
│ ├── bukkit.yml
|
||||
│ ├── spigot.yml
|
||||
│ ├── purpur.yml
|
||||
│ ├── pufferfish.yml
|
||||
│ └── server.properties
|
||||
├── 1.20.4/
|
||||
│ └── ...
|
||||
└── README.md
|
||||
```
|
||||
|
||||
## Docker Compose Examples
|
||||
|
||||
### 1. Paper Server
|
||||
|
||||
For Paper, use `PAPER_CONFIG_REPO`.
|
||||
|
||||
```yaml
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
TYPE: "PAPER"
|
||||
VERSION: "1.21.1"
|
||||
|
||||
# URL to the root of your config repository (e.g. raw.githubusercontent.com)
|
||||
# The script automatically appends "/<VERSION>/<FILE>" to this URL.
|
||||
PAPER_CONFIG_REPO: "https://raw.githubusercontent.com/Alpha018/paper-config-optimized/refs/heads/main"
|
||||
```
|
||||
|
||||
### 2. Purpur Server
|
||||
|
||||
For Purpur, use `PURPUR_CONFIG_REPO`.
|
||||
|
||||
```yaml
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
TYPE: "PURPUR"
|
||||
VERSION: "1.21.1"
|
||||
|
||||
# URL to the root of your config repository (e.g. raw.githubusercontent.com)
|
||||
# The script automatically appends "/<VERSION>/<FILE>" to this URL.
|
||||
PURPUR_CONFIG_REPO: "https://raw.githubusercontent.com/Alpha018/paper-config-optimized/refs/heads/main"
|
||||
```
|
||||
|
||||
### 2. Pufferfish Server
|
||||
|
||||
For Pufferfish, use `PUFFERFISH_CONFIG_REPO`.
|
||||
|
||||
```yaml
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
TYPE: "PUFFERFISH"
|
||||
VERSION: "1.21.1" # Must match a folder in your repo
|
||||
|
||||
# Automagically download optimized configs (bukkit.yml, spigot.yml, pufferfish.yml)
|
||||
PUFFERFISH_CONFIG_REPO: "https://raw.githubusercontent.com/Alpha018/paper-config-optimized/refs/heads/main"
|
||||
```
|
||||
|
||||
### 3. Downloading `server.properties` (Optional)
|
||||
|
||||
If you also want to download a base `server.properties` file from your repository, you must explicitly set `SERVER_PROPERTIES_REPO_URL`.
|
||||
|
||||
**Smart Feature**:
|
||||
|
||||
- If you provide a **base URL** (like the repo root), the script will automatically append `/<VERSION>/server.properties`.
|
||||
- If you provide a **full URL** (ending in `.properties`), it will download that specific file.
|
||||
|
||||
**Crucial Note**: Environment variables (like `MOTD`, `DIFFICULTY`, `MAX_PLAYERS`) in your Docker Compose **WILL override** values in the downloaded file. This allows you to have a shared optimized base but customize specifics per instance.
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
# ... other vars ...
|
||||
|
||||
# Option A: Base URL (Smart)
|
||||
# Will look for: https://.../main/1.21.1/server.properties
|
||||
SERVER_PROPERTIES_REPO_URL: "https://raw.githubusercontent.com/Alpha018/paper-config-optimized/refs/heads/main"
|
||||
|
||||
# Option B: Specific URL (Manual)
|
||||
# SERVER_PROPERTIES_REPO_URL: "https://gist.githubusercontent.com/.../server.properties"
|
||||
|
||||
# These will OVERRIDE settings in the downloaded file
|
||||
MOTD: "My Custom Instance"
|
||||
MAX_PLAYERS: 50
|
||||
```
|
||||
|
||||
## Supported Variables
|
||||
|
||||
| Variable | Description |
|
||||
| :--- | :--- |
|
||||
| `PAPER_CONFIG_REPO` | Base URL for Paper configs. Downloads `paper-global.yml`, `bukkit.yml`, `spigot.yml`, etc. |
|
||||
| `PURPUR_CONFIG_REPO` | Base URL for Purpur configs. Downloads `purpur.yml`, `bukkit.yml`, `spigot.yml`. |
|
||||
| `PUFFERFISH_CONFIG_REPO` | Base URL for Pufferfish configs. Downloads `pufferfish.yml`, `bukkit.yml`, `spigot.yml`. |
|
||||
| `SERVER_PROPERTIES_REPO_URL` | Boolean/URL. Set to download `server.properties`. Can be a base URL or direct file link. |
|
||||
|
||||
## Contribution
|
||||
|
||||
Got ideas to squeeze even more performance out of these configs? Or maybe you found a better way to structure things?
|
||||
|
||||
I'd love to see your improvements! Feel free to open a Pull Request or an Issue in the [repository](https://github.com/Alpha018/paper-config-optimized). Let's make these configs the best they can be together.
|
||||
@@ -110,6 +110,7 @@
|
||||
"mouse-tweaks",
|
||||
"neat",
|
||||
"nekos-enchanted-books",
|
||||
"neoculus",
|
||||
"no-nv-flash",
|
||||
"no-recipe-book",
|
||||
"not-enough-animations",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{
|
||||
"tag": "stable",
|
||||
"notes": "Always tracks the most recent release",
|
||||
"java": "21",
|
||||
"java": "25",
|
||||
"distribution": "ubuntu",
|
||||
"jvm": "hotspot",
|
||||
"architectures": ["amd64", "arm64"],
|
||||
@@ -77,13 +77,6 @@
|
||||
"architectures": ["amd64", "arm64"],
|
||||
"jdk": true
|
||||
},
|
||||
{
|
||||
"tag": "java21-graalvm",
|
||||
"java": "21",
|
||||
"distribution": "oracle",
|
||||
"jvm": "graalvm",
|
||||
"architectures": ["amd64", "arm64"]
|
||||
},
|
||||
{
|
||||
"tag": "java17",
|
||||
"java": "17",
|
||||
|
||||
15
renovate.json5
Normal file
15
renovate.json5
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"enabledManagers": [
|
||||
"custom.regex"
|
||||
],
|
||||
"customManagers": [
|
||||
{
|
||||
"customType": "regex",
|
||||
"managerFilePatterns": ["/^Dockerfile$/"],
|
||||
"matchStrings": [
|
||||
"# renovate: datasource=(?<datasource>[a-z-]+?)(?: packageName=(?<packageName>.+?))?(?: versioning=(?<versioning>[a-z-]+))?\\s(?:ENV|ARG) .+?_VERSION=(?<currentValue>.+?)\\s"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
0
scripts/start-deployAutoCF
Normal file → Executable file
0
scripts/start-deployAutoCF
Normal file → Executable file
0
scripts/start-deployFolia
Normal file → Executable file
0
scripts/start-deployFolia
Normal file → Executable file
7
scripts/start-deployGTNH
Normal file → Executable file
7
scripts/start-deployGTNH
Normal file → Executable file
@@ -8,10 +8,11 @@ function getGTNHdownloadPath(){
|
||||
gtnh_download_path=""
|
||||
current_java_version=$(mc-image-helper java-release)
|
||||
|
||||
if ! mapfile -t packs < <(curl -sfL 'http://downloads.gtnewhorizons.com/ServerPacks/?raw'); then
|
||||
if ! packs_data="$(restify --tag=a https://www.gtnewhorizons.com/version-history/ | jq -r '.[].href | select(test("Server"))')"; then
|
||||
logError "Failed to retrieve data from http://downloads.gtnewhorizons.com/ServerPacks/?raw"
|
||||
exit 1
|
||||
fi
|
||||
mapfile -t packs <<< "$packs_data"
|
||||
|
||||
log "Start locating server files..."
|
||||
for pack in "${packs[@]}"; do
|
||||
@@ -253,7 +254,7 @@ export ALLOW_FLIGHT="${ALLOW_FLIGHT:=true}"
|
||||
export LEVEL_TYPE="${LEVEL_TYPE:=rwg}"
|
||||
export DIFFICULTY="${DIFFICULTY:=3}"
|
||||
export ENABLE_COMMAND_BLOCK="${ENABLE_COMMAND_BLOCK:=true}"
|
||||
export MOTD="${MOTD:="Greg Tech New Horizon $GTNH_PACK_VERSION"}"
|
||||
export MOTD="${MOTD:="Greg Tech New Horizons $GTNH_PACK_VERSION"}"
|
||||
debug "Set MOTD=$MOTD, ENABLE_COMMAND_BLOCK=$ENABLE_COMMAND_BLOCK, DIFFICULTY=$DIFFICULTY, LEVEL_TYPE=$LEVEL_TYPE, ALLOW_FLIGHT=$ALLOW_FLIGHT"
|
||||
|
||||
isDebugging && set -x
|
||||
@@ -278,4 +279,4 @@ handleGTNH
|
||||
|
||||
export USES_MODS=true
|
||||
|
||||
exec "$(dirname "$0")/start-setupWorld" "$@"
|
||||
exec "$(dirname "$0")/start-setupWorld" "$@"
|
||||
|
||||
0
scripts/start-deployLeaf
Normal file → Executable file
0
scripts/start-deployLeaf
Normal file → Executable file
0
scripts/start-deployModrinth
Normal file → Executable file
0
scripts/start-deployModrinth
Normal file → Executable file
12
scripts/start-deployNeoForge
Normal file → Executable file
12
scripts/start-deployNeoForge
Normal file → Executable file
@@ -2,6 +2,7 @@
|
||||
|
||||
: "${NEOFORGE_VERSION:=latest}"
|
||||
: "${NEOFORGE_FORCE_REINSTALL:=false}}"
|
||||
: "${NEOFORGE_INSTALLER:=}"
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
|
||||
@@ -9,14 +10,19 @@ isDebugging && set -x
|
||||
|
||||
resultsFile=/data/.run-neoforge.env
|
||||
|
||||
if ! mc-image-helper install-neoforge \
|
||||
if [[ ${NEOFORGE_INSTALLER} ]]; then
|
||||
if ! mc-image-helper install-neoforge --neoforge-installer="${NEOFORGE_INSTALLER}" --output-directory=/data --results-file=${resultsFile} --minecraft-version="${VERSION}" --force-reinstall="${NEOFORGE_FORCE_REINSTALL}"; then
|
||||
logError "Failed to installForge given installer ${NEOFORGE_INSTALLER}"
|
||||
exit 1
|
||||
fi
|
||||
elif ! mc-image-helper install-neoforge \
|
||||
--output-directory=/data \
|
||||
--results-file=${resultsFile} \
|
||||
--minecraft-version="${VERSION}" \
|
||||
--neoforge-version="${NEOFORGE_VERSION}" \
|
||||
--force-reinstall="${NEOFORGE_FORCE_REINSTALL}"; then
|
||||
logError "Failed to install NeoForge"
|
||||
exit 1
|
||||
logError "Failed to install NeoForge"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
applyResultsFile ${resultsFile}
|
||||
|
||||
0
scripts/start-deployPoseidon
Normal file → Executable file
0
scripts/start-deployPoseidon
Normal file → Executable file
@@ -41,6 +41,11 @@ if [[ ! -f "$SERVER" ]] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
if [[ "${PUFFERFISH_CONFIG_REPO}" ]]; then
|
||||
defaultTopLevelConfigs=(bukkit.yml spigot.yml pufferfish.yml)
|
||||
DOWNLOAD_DEFAULTS=$(buildDownloadList "$PUFFERFISH_CONFIG_REPO" "$VERSION" "${defaultTopLevelConfigs[@]}")
|
||||
export DOWNLOAD_DEFAULTS
|
||||
fi
|
||||
|
||||
# Normalize on Spigot for later operations
|
||||
export FAMILY=SPIGOT
|
||||
|
||||
@@ -4,6 +4,7 @@ IFS=$'\n\t'
|
||||
|
||||
: "${PURPUR_BUILD:=LATEST}"
|
||||
: "${PURPUR_DOWNLOAD_URL:=}"
|
||||
: "${PURPUR_CONFIG_REPO:=}"
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "$(dirname "$0")/start-utils"
|
||||
@@ -36,6 +37,12 @@ fi
|
||||
|
||||
applyResultsFile ${resultsFile}
|
||||
|
||||
if [[ "${PURPUR_CONFIG_REPO}" ]]; then
|
||||
defaultTopLevelConfigs=(bukkit.yml spigot.yml purpur.yml)
|
||||
DOWNLOAD_DEFAULTS=$(buildDownloadList "$PURPUR_CONFIG_REPO" "$VERSION" "${defaultTopLevelConfigs[@]}")
|
||||
export DOWNLOAD_DEFAULTS
|
||||
fi
|
||||
|
||||
# Normalize on Spigot for later operations
|
||||
export FAMILY=SPIGOT
|
||||
|
||||
|
||||
0
scripts/start-rconcmds
Normal file → Executable file
0
scripts/start-rconcmds
Normal file → Executable file
0
scripts/start-setupRbac
Normal file → Executable file
0
scripts/start-setupRbac
Normal file → Executable file
@@ -134,6 +134,22 @@ if [[ ${TYPE} == "CURSEFORGE" ]]; then
|
||||
fi
|
||||
|
||||
if ! isTrue "${SKIP_SERVER_PROPERTIES}"; then
|
||||
if [ ! -e "$SERVER_PROPERTIES" ] && [[ "${SERVER_PROPERTIES_REPO_URL:-}" ]]; then
|
||||
# Helper to support base URLs (like the config repos)
|
||||
# If the URL doesn't end in .properties, assume it is a base and append version/file
|
||||
if [[ "${SERVER_PROPERTIES_REPO_URL}" != *".properties" ]]; then
|
||||
SERVER_PROPERTIES_REPO_URL=$(buildDownloadList "$SERVER_PROPERTIES_REPO_URL" "$VERSION" server.properties)
|
||||
fi
|
||||
|
||||
if ! mc-image-helper mcopy \
|
||||
--to "$(dirname "$SERVER_PROPERTIES")" \
|
||||
--skip-existing \
|
||||
--ignore-missing-sources \
|
||||
"$SERVER_PROPERTIES_REPO_URL"; then
|
||||
logWarning "Failed to download server.properties from ${SERVER_PROPERTIES_REPO_URL}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -e "$SERVER_PROPERTIES" ]; then
|
||||
log "Creating server properties in ${SERVER_PROPERTIES}"
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ features = [
|
||||
"navigation.tabs",
|
||||
"navigation.tabs.sticky",
|
||||
"navigation.sections",
|
||||
"navigation.expand",
|
||||
"navigation.top",
|
||||
"navigation.indexes"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user