paper: updated to 1.19.2 & added dumb-init to image

master
Jef Roosens 2022-09-25 17:52:28 +02:00
parent 23f7911271
commit a904ef47d0
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
2 changed files with 24 additions and 8 deletions

View File

@ -2,13 +2,12 @@ version: '3.4'
services: services:
app: app:
image: 'chewingbever/mc-paper:1.18.2-305' image: 'git.rustybever.be/chewing_bever/mc-paper:1.19.2-173'
build: build:
context: paper context: paper
args: args:
- 'BASE_IMAGE=openjdk:17-slim' - 'MC_VERSION=1.19.2'
- 'MC_VERSION=1.18.2' - 'PAPERMC_VERSION=173'
- 'PAPERMC_VERSION=305'
# These are necessary to make the console work # These are necessary to make the console work
stdin_open: true stdin_open: true
@ -19,8 +18,7 @@ services:
replicas: 1 replicas: 1
placement: placement:
constraints: constraints:
- 'node.labels.class==gitea' - 'node.labels.class==papermc'
# This makes sure the Minecraft server can never choke my Gitea completely
resources: resources:
limits: limits:
cpus: '4.0' cpus: '4.0'

View File

@ -1,8 +1,23 @@
ARG BASE_IMAGE 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 # We use ${:-} instead of a default value because the argument is always passed
# to the build, it'll just be blank most likely # to the build, it'll just be blank most likely
FROM ${BASE_IMAGE:-'openjdk:17-slim'} FROM ${BASE_IMAGE:-'openjdk:18-slim'}
# Build arguments # Build arguments
ARG MC_VERSION ARG MC_VERSION
@ -42,9 +57,12 @@ EXPOSE 25565
USER paper:paper USER paper:paper
# Entrypoint runs in /app/config # Entrypoint runs in /app/config
COPY --from=dumb-init-builder /app/dumb-init /dumb-init
COPY entrypoint.sh /entrypoint.sh COPY entrypoint.sh /entrypoint.sh
WORKDIR /app/config WORKDIR /app/config
ENTRYPOINT /entrypoint.sh ENTRYPOINT ["/dumb-init", "--"]
CMD /entrypoint.sh
HEALTHCHECK --interval=30s --timeout=5s --start-period=1m --retries=5 \ HEALTHCHECK --interval=30s --timeout=5s --start-period=1m --retries=5 \
CMD mcstatus localhost:25565 ping CMD mcstatus localhost:25565 ping