Newer
Older
org.label-schema.description="Docker Container for an Papermc Server" \
org.label-schema.vcs-url="https://gitlab.cl.uni-heidelberg.de/tmueller/clspigot-docker/" \
maintainer="mueller@tobistech.ovh" \
org.label-schema.schema-version=1.0
# Execute all the following instructions in the container as user "root"
# User and group used to run the PaperMC server (build time argument, defaulting to "papermc")
ARG papermc_user=papermc
ARG papermc_group=papermc
ARG vcsref=""
# Default environment variables
# The Java Options are Aikar's flags to optimize a few things, among them garbage collection:
# https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/
JAVA_OPTS="-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true" \
#Man kann nun auch die guid des eigenen benutzers passen und mus somit nichtmehr die rechte des hostsystems anpassen, bitte die GUID eines non-root users nehmen der an dem speicherort zugriff hat.
TM_BASE_AUTH="username:supercooles_passwort_hier_einfuegen" \
TM_BASE_URL=""
# Copy over the three script files (entrypoint, backup, restore, helath, test(optional) and crontab
COPY papermc.sh backup.sh restore.sh health.sh test.sh /
COPY crontab /etc/cron.d/backup
# Set Timezone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Create /papermc and /backup directories and /web for the dynmap
#sets permission for the cronjobs
RUN chmod 0644 /etc/cron.d/backup
# Add papermc user and group, then change ownership of /papermc and /backup to this user
RUN groupadd -g ${GUID} ${papermc_group}
RUN useradd -g ${GUID} -l -M -s /bin/false -u ${GUID} ${papermc_user}
# Get package lists, install needed packages, then remove the package lists again (to save space)
# "webp" is needed to generate images with better compression for the dynamic map (optional, needs further configuration in dynmap-plugin´s config file)
# "cron" is for making it possible to restart the server every day, week or soemthing similar (its optional)
# "curl" is required for getting the server initialised
# "screen" is required for getting the server running at all
RUN apt-get update && apt-get install -y \
cron \
curl \
jq \
screen \
webp \
# Execute all following commands as the papermc user
USER $papermc_user
# Start script and also entrypoint for the container
CMD ["sh", "/papermc.sh"]
#Alle 10s testen ob exit code = 0
HEALTHCHECK --interval=10s --timeout=10s --start-period=30s \
CMD ["sh", "/health.sh"]
# Container setup, specifies needed ports. May be adjusted or overwritten if plugins need other ports
tmueller
committed
VOLUME /backup