From 6a8bcffa17c1e5412ae5d261a0f72ffdf4a1f1c0 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 1 Nov 2025 22:30:27 -0500 Subject: [PATCH] Updated example snippets for CF_PAGE_URL and CF_SLUG (#3740) --- docs/index.md | 29 ++++++++++++--- .../mod-platforms/auto-curseforge.md | 37 +++++++++++++++---- 2 files changed, 52 insertions(+), 14 deletions(-) diff --git a/docs/index.md b/docs/index.md index 30a37122..4e0fc1bc 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,9 +13,30 @@ latest snapshot. See the _Versions_ section below for more information. To simply use the latest stable version, run - docker run -d -it --pull=always -p 25565:25565 -e EULA=TRUE itzg/minecraft-server + docker run -d -it -p 25565:25565 -e EULA=TRUE itzg/minecraft-server -where, in this case, the standard server port 25565, will be exposed on your host machine. +where, in this case, the standard server port 25565 will be exposed on your host machine. + +!!! important "Persistent Data" + + The Minecraft server will store its data in the container's `/data` directory. This directory can be [mounted](https://docs.docker.com/storage/volumes/) from the host machine or a managed volume. + + Using `docker run` add a `-v` option somewhere before the image name: + + ``` + ... -v /path/on/host:/data itzg/minecraft-server + ``` + + Using docker compose, add a `volumes` section to the service definition: + + ```yaml + services: + mc: + # ... image and environment section + volumes: + # attach the relative directory 'data' to the container's /data path + ./data:data + ``` !!! note @@ -25,10 +46,6 @@ where, in this case, the standard server port 25565, will be exposed on your hos Be sure to always include `-e EULA=TRUE` in your commands and container definitions, as Mojang/Microsoft requires EULA acceptance. -!!! warning - - **DO NOT** port forward RCON on 25575 without first setting `RCON_PASSWORD` to a secure value. It is highly recommended to only use RCON within the container, such as with `rcon-cli`. - By default, the container will download the latest version of the "vanilla" [Minecraft: Java Edition server](https://www.minecraft.net/en-us/download/server) provided by Mojang. The [`VERSION`](versions/minecraft.md) and the [`TYPE`](types-and-platforms/index.md) can be configured to create many variations of desired Minecraft server. ## Using [Docker Compose](https://docs.docker.com/compose/) diff --git a/docs/types-and-platforms/mod-platforms/auto-curseforge.md b/docs/types-and-platforms/mod-platforms/auto-curseforge.md index 661a5639..b952b842 100644 --- a/docs/types-and-platforms/mod-platforms/auto-curseforge.md +++ b/docs/types-and-platforms/mod-platforms/auto-curseforge.md @@ -71,20 +71,41 @@ To manage a CurseForge modpack automatically with upgrade support, pinned or lat Use one of the following to specify the modpack to install: -Pass a page URL to the modpack or a specific file with `CF_PAGE_URL` such as the modpack page "https://www.curseforge.com/minecraft/modpacks/all-the-mods-8" or a specific file "https://www.curseforge.com/minecraft/modpacks/all-the-mods-8/files/4248390". For example: +Pass a page URL to the modpack or a specific file with `CF_PAGE_URL` such as the modpack page "https://www.curseforge.com/minecraft/modpacks/all-the-mods-8" or a specific file "https://www.curseforge.com/minecraft/modpacks/all-the-mods-8/files/4248390". -``` --e TYPE=AUTO_CURSEFORGE -e CF_PAGE_URL=https://www.curseforge.com/minecraft/modpacks/all-the-mods-8 -``` +!!! example "Using CF_PAGE_URL" + + ```yaml title="Using compose.yaml" + environment: + # ... + MODPACK_PLATFORM: AUTO_CURSEFORGE + # allocate from https://console.curseforge.com/ and set in .env file + CF_API_KEY: ${CF_API_KEY} + CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-the-mods-8 + ``` + + ```title="Using docker run" + docker run -e CF_API_KEY=${CF_API_KEY} -e TYPE=AUTO_CURSEFORGE -e CF_PAGE_URL=https://www.curseforge.com/minecraft/modpacks/all-the-mods-8 + ``` Instead of a URL, the modpack slug can be provided as `CF_SLUG`. The slug is the short identifier visible in the URL after "/modpacks/", such as ![cf-slug](../../img/cf-slug.png) -For example: -``` --e TYPE=AUTO_CURSEFORGE -e CF_SLUG=all-the-mods-8 -``` +!!! example "Using CF_SLUG" + + ```yaml title="Using compose.yaml" + environment: + # ... + MODPACK_PLATFORM: AUTO_CURSEFORGE + # allocate from https://console.curseforge.com/ and set in .env file + CF_API_KEY: ${CF_API_KEY} + CF_SLUG: all-the-mods-8 + ``` + + ```title="Using docker run" + docker run -e CF_API_KEY=${CF_API_KEY} -e TYPE=AUTO_CURSEFORGE -e CF_SLUG=all-the-mods-8 + ``` ### Pinning modpack and mod loader versions