From a904ef47d08f54f079df6f22dc7f7b39270ebd75 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Sun, 25 Sep 2022 17:52:28 +0200 Subject: [PATCH] paper: updated to 1.19.2 & added dumb-init to image --- stacks/paper.yml | 10 ++++------ stacks/paper/Dockerfile | 22 ++++++++++++++++++++-- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/stacks/paper.yml b/stacks/paper.yml index 1dd3764..0c37d7c 100644 --- a/stacks/paper.yml +++ b/stacks/paper.yml @@ -2,13 +2,12 @@ version: '3.4' services: app: - image: 'chewingbever/mc-paper:1.18.2-305' + image: 'git.rustybever.be/chewing_bever/mc-paper:1.19.2-173' build: context: paper args: - - 'BASE_IMAGE=openjdk:17-slim' - - 'MC_VERSION=1.18.2' - - 'PAPERMC_VERSION=305' + - 'MC_VERSION=1.19.2' + - 'PAPERMC_VERSION=173' # These are necessary to make the console work stdin_open: true @@ -19,8 +18,7 @@ services: replicas: 1 placement: constraints: - - 'node.labels.class==gitea' - # This makes sure the Minecraft server can never choke my Gitea completely + - 'node.labels.class==papermc' resources: limits: cpus: '4.0' diff --git a/stacks/paper/Dockerfile b/stacks/paper/Dockerfile index 0878496..6c6af46 100644 --- a/stacks/paper/Dockerfile +++ b/stacks/paper/Dockerfile @@ -1,8 +1,23 @@ ARG BASE_IMAGE +# Build dumb-init +FROM alpine AS dumb-init-builder + +ARG DI_VER=1.2.5 + +WORKDIR /app + +# Build dumb-init & download tshock +RUN apk add --update --no-cache build-base unzip curl && \ + curl -Lo - "https://github.com/Yelp/dumb-init/archive/refs/tags/v${DI_VER}.tar.gz" | tar -xzf - && \ + cd "dumb-init-${DI_VER}" && \ + make SHELL=/bin/sh && \ + mv dumb-init .. + + # We use ${:-} instead of a default value because the argument is always passed # to the build, it'll just be blank most likely -FROM ${BASE_IMAGE:-'openjdk:17-slim'} +FROM ${BASE_IMAGE:-'openjdk:18-slim'} # Build arguments ARG MC_VERSION @@ -42,9 +57,12 @@ EXPOSE 25565 USER paper:paper # Entrypoint runs in /app/config +COPY --from=dumb-init-builder /app/dumb-init /dumb-init COPY entrypoint.sh /entrypoint.sh + WORKDIR /app/config -ENTRYPOINT /entrypoint.sh +ENTRYPOINT ["/dumb-init", "--"] +CMD /entrypoint.sh HEALTHCHECK --interval=30s --timeout=5s --start-period=1m --retries=5 \ CMD mcstatus localhost:25565 ping