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
# Mount points
CONFIG_DIR=
WORLDS_DIR=
CONFIG_DIR=config
WORLDS_DIR=worlds
# Other
PORT=25565

View File

@ -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

View File

@ -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: