Updated papermc

pull/3/head
Jef Roosens 2021-01-13 14:21:38 +01:00
parent 6f40029a9c
commit 7ac4f82a85
3 changed files with 25 additions and 18 deletions

View File

@ -23,8 +23,8 @@ XMS=4
XMX=4 XMX=4
# Mount points # Mount points
CONFIG_DIR= CONFIG_DIR=config
WORLDS_DIR= WORLDS_DIR=worlds
# Other # Other
PORT=25565 PORT=25565

View File

@ -21,23 +21,26 @@ ARG MC_VERSION
ARG PAPERMC_VERSION ARG PAPERMC_VERSION
# Create worlds and config directory # Create worlds and config directory
WORKDIR /mc WORKDIR /app
RUN mkdir worlds config RUN mkdir worlds config
# Download server file # Download server file
ADD "https://papermc.io/api/v1/paper/$MC_VERSION/$PAPERMC_VERSION/download" server.jar 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 # 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 # Default value to keep users from eating up all ram accidentally
ENV XMS=4 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 # We copy over the server jar(s) as well to make the backup more reproducible to deploy
ENTRYPOINT mv -n /mc/*.jar /mc/config && \ ENTRYPOINT mv -n /app/*.jar /app/config && \
echo "eula=true" > /mc/config/eula.txt && \ echo "eula=true" > /app/config/eula.txt && \
java \ java \
-Xms"${XMS}G" \ -Xms"${XMS}G" \
-Xmx"${XMX:-$XMS}G" \ -Xmx"${XMX:-$XMS}G" \
@ -61,6 +64,6 @@ java \
-XX:MaxTenuringThreshold=1 \ -XX:MaxTenuringThreshold=1 \
-Dusing.aikars.flags=https://mcflags.emc.gs \ -Dusing.aikars.flags=https://mcflags.emc.gs \
-Daikars.new.flags=true \ -Daikars.new.flags=true \
-jar /mc/server.jar \ -jar /app/server.jar \
--universe /mc/worlds \ --universe /app/worlds \
--nogui --nogui

View File

@ -19,21 +19,25 @@ services:
papermc: papermc:
build: build:
context: . context: .
dockerfile: Dockerfile
args: args:
- 'MC_VERSION=${MC_VERSION}' - 'MC_VERSION'
- 'PAPERMC_VERSION=${PAPERMC_VERSION}' - 'PAPERMC_VERSION'
image: 'mc-papermc-server:${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 stdin_open: true
tty: true tty: true
environment: environment:
- XMS - 'XMS'
- XMX - 'XMX'
ports: ports:
- '$PORT:25565' - '$PORT:25565'
volumes: volumes:
- '$CONFIG_DIR:/minecraft/config' - '$CONFIG_DIR:/app/config'
- '$WORLDS_DIR:/minecraft/worlds' - '$WORLDS_DIR:/app/worlds'
volumes:
config:
worlds: