From 7ac4f82a859c35ad68780aff140d99dfb65bc2a2 Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Wed, 13 Jan 2021 14:21:38 +0100 Subject: [PATCH] Updated papermc --- minecraft/papermc/.env.example | 4 ++-- minecraft/papermc/Dockerfile | 17 ++++++++++------- minecraft/papermc/docker-compose.yml | 22 +++++++++++++--------- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/minecraft/papermc/.env.example b/minecraft/papermc/.env.example index 71b3bdf..a9aa5f8 100644 --- a/minecraft/papermc/.env.example +++ b/minecraft/papermc/.env.example @@ -23,8 +23,8 @@ XMS=4 XMX=4 # Mount points -CONFIG_DIR= -WORLDS_DIR= +CONFIG_DIR=config +WORLDS_DIR=worlds # Other PORT=25565 diff --git a/minecraft/papermc/Dockerfile b/minecraft/papermc/Dockerfile index 75fa54f..6952e3c 100644 --- a/minecraft/papermc/Dockerfile +++ b/minecraft/papermc/Dockerfile @@ -21,23 +21,26 @@ ARG MC_VERSION ARG PAPERMC_VERSION # Create worlds and config directory -WORKDIR /mc +WORKDIR /app RUN mkdir worlds config # Download server file ADD "https://papermc.io/api/v1/paper/$MC_VERSION/$PAPERMC_VERSION/download" server.jar # Store the cache in an anonymous volume, which means it won't get stored in the other volumes -VOLUME /mc/config/cache +VOLUME /app/config/cache -WORKDIR /mc/config +WORKDIR /app/config # Default value to keep users from eating up all ram accidentally ENV XMS=4 +# Document exposed ports +EXPOSE 25565 + # We copy over the server jar(s) as well to make the backup more reproducible to deploy -ENTRYPOINT mv -n /mc/*.jar /mc/config && \ -echo "eula=true" > /mc/config/eula.txt && \ +ENTRYPOINT mv -n /app/*.jar /app/config && \ +echo "eula=true" > /app/config/eula.txt && \ java \ -Xms"${XMS}G" \ -Xmx"${XMX:-$XMS}G" \ @@ -61,6 +64,6 @@ java \ -XX:MaxTenuringThreshold=1 \ -Dusing.aikars.flags=https://mcflags.emc.gs \ -Daikars.new.flags=true \ --jar /mc/server.jar \ ---universe /mc/worlds \ +-jar /app/server.jar \ +--universe /app/worlds \ --nogui diff --git a/minecraft/papermc/docker-compose.yml b/minecraft/papermc/docker-compose.yml index b0dd0d1..0ecdaa8 100644 --- a/minecraft/papermc/docker-compose.yml +++ b/minecraft/papermc/docker-compose.yml @@ -19,21 +19,25 @@ services: papermc: build: context: . - dockerfile: Dockerfile args: - - 'MC_VERSION=${MC_VERSION}' - - 'PAPERMC_VERSION=${PAPERMC_VERSION}' - image: 'mc-papermc-server:${MC_VERSION}-${PAPERMC_VERSION}' + - 'MC_VERSION' + - 'PAPERMC_VERSION' + image: 'chewingbever/mc-papermc-server:${MC_VERSION}-${PAPERMC_VERSION}' + restart: 'always' - restart: unless-stopped + # Needed to interact with server console stdin_open: true tty: true environment: - - XMS - - XMX + - 'XMS' + - 'XMX' ports: - '$PORT:25565' volumes: - - '$CONFIG_DIR:/minecraft/config' - - '$WORLDS_DIR:/minecraft/worlds' + - '$CONFIG_DIR:/app/config' + - '$WORLDS_DIR:/app/worlds' + +volumes: + config: + worlds: