paper: use alex; update version
parent
3ceb9edb46
commit
f593bad484
|
@ -2,12 +2,12 @@ version: '3.4'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: 'git.rustybever.be/chewing_bever/mc-paper:1.19.4-525'
|
image: 'git.rustybever.be/chewing_bever/mc-paper:1.19.4-550'
|
||||||
build:
|
build:
|
||||||
context: paper
|
context: paper
|
||||||
args:
|
args:
|
||||||
- 'MC_VERSION=1.19.4'
|
- 'MC_VERSION=1.19.4'
|
||||||
- 'PAPERMC_VERSION=525'
|
- 'PAPERMC_VERSION=550'
|
||||||
|
|
||||||
# These are necessary to make the console work
|
# These are necessary to make the console work
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
|
@ -24,14 +24,18 @@ services:
|
||||||
cpus: '4.0'
|
cpus: '4.0'
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
- 'XMS=4'
|
- 'ALEX_XMS=4096'
|
||||||
- 'XMX=8'
|
- 'ALEX_XMX=8192'
|
||||||
|
- 'ALEX_MAX_BACKUPS=28'
|
||||||
|
- 'ALEX_FREQUENCY=360'
|
||||||
ports:
|
ports:
|
||||||
- '25565:25565'
|
- '25565:25565'
|
||||||
volumes:
|
volumes:
|
||||||
- 'config:/app/config'
|
- 'config:/app/config'
|
||||||
- 'worlds:/app/worlds'
|
- 'worlds:/app/worlds'
|
||||||
|
- 'backups:/app/backups'
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
config:
|
config:
|
||||||
worlds:
|
worlds:
|
||||||
|
backups:
|
||||||
|
|
|
@ -17,24 +17,22 @@ RUN apk add --update --no-cache build-base unzip curl && \
|
||||||
|
|
||||||
# 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:18-slim'}
|
FROM ${BASE_IMAGE:-'eclipse-temurin:18-jre-alpine'}
|
||||||
|
|
||||||
# Build arguments
|
# Build arguments
|
||||||
ARG MC_VERSION
|
ARG MC_VERSION
|
||||||
ARG PAPERMC_VERSION
|
ARG PAPERMC_VERSION
|
||||||
|
|
||||||
# Install mcstatus for healthchecks
|
# Install alex binary
|
||||||
RUN apt update && \
|
ADD "https://git.rustybever.be/api/packages/Chewing_Bever/generic/alex/0.2.2/alex-linux-amd64" /bin/alex
|
||||||
apt install --no-install-recommends -y python3-minimal python3-setuptools python3-pip && \
|
|
||||||
python3 -m pip install mcstatus && \
|
RUN chmod +x /bin/alex && \
|
||||||
apt --purge remove -y python3-pip python3-setuptools && \
|
addgroup -Sg 1000 paper && \
|
||||||
apt clean && \
|
adduser -SHG paper -u 1000 paper
|
||||||
groupadd -g 1000 paper && \
|
|
||||||
useradd -rMg paper -u 1000 paper
|
|
||||||
|
|
||||||
# Create worlds and config directory
|
# Create worlds and config directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN mkdir -p worlds config/cache
|
RUN mkdir -p worlds config/cache backups
|
||||||
|
|
||||||
# Download server file
|
# Download server file
|
||||||
ADD "https://papermc.io/api/v2/projects/paper/versions/$MC_VERSION/builds/$PAPERMC_VERSION/downloads/paper-$MC_VERSION-$PAPERMC_VERSION.jar" server.jar
|
ADD "https://papermc.io/api/v2/projects/paper/versions/$MC_VERSION/builds/$PAPERMC_VERSION/downloads/paper-$MC_VERSION-$PAPERMC_VERSION.jar" server.jar
|
||||||
|
@ -45,10 +43,11 @@ RUN chown -R paper:paper /app
|
||||||
# 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 /app/config/cache
|
VOLUME /app/config/cache
|
||||||
|
|
||||||
# Default value to keep users from eating up all ram accidentally
|
ENV ALEX_JAR=/app/server.jar \
|
||||||
ENV XMX=4
|
ALEX_CONFIG_DIR=/app/config \
|
||||||
ENV MC_VERSION="${MC_VERSION}"
|
ALEX_WORLD_DIR=/app/worlds \
|
||||||
ENV PAPERMC_VERSION="${PAPERMC_VERSION}"
|
ALEX_BACKUP_DIR=/app/backups \
|
||||||
|
ALEX_SERVER_VERSION="${MC_VERSION}-${PAPERMC_VERSION}"
|
||||||
|
|
||||||
# Document exposed ports
|
# Document exposed ports
|
||||||
EXPOSE 25565
|
EXPOSE 25565
|
||||||
|
@ -56,13 +55,10 @@ EXPOSE 25565
|
||||||
# Switch to non-root user
|
# Switch to non-root user
|
||||||
USER paper:paper
|
USER paper:paper
|
||||||
|
|
||||||
# Entrypoint runs in /app/config
|
|
||||||
COPY --from=dumb-init-builder /app/dumb-init /dumb-init
|
COPY --from=dumb-init-builder /app/dumb-init /dumb-init
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
|
||||||
|
|
||||||
WORKDIR /app/config
|
|
||||||
ENTRYPOINT ["/dumb-init", "--"]
|
ENTRYPOINT ["/dumb-init", "--"]
|
||||||
CMD /entrypoint.sh
|
CMD /bin/alex paper
|
||||||
|
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue