-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Use multi-stage docker build to reuse keepup download logic
chore: Bump keepup, use new configs feature
- Loading branch information
Showing
4 changed files
with
55 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,21 @@ | |
# Environment: Java | ||
# Minimum Panel Version: 0.6.0 | ||
# ---------------------------------- | ||
FROM itzg/minecraft-server:java21-alpine | ||
LABEL org.opencontainers.image.authors="Offz <[email protected]>" | ||
|
||
RUN apk add --no-cache ansible-core rclone wget unzip jq openssh | ||
FROM alpine as helper | ||
ARG KEEPUP_VERSION='3.0.0-alpha.1' | ||
RUN wget -nv -q -O keepup.zip https://github.com/MineInAbyss/Keepup/releases/download/v${KEEPUP_VERSION}/keepup-shadow-${KEEPUP_VERSION}.zip \ | ||
# unzip file inside hocon-to-json.zip into /usr/local \ | ||
&& unzip -q keepup.zip \ | ||
&& mv keepup-shadow-${KEEPUP_VERSION}/ keepup | ||
# Install YourKit Java Profiler agents | ||
#RUN wget -q https://www.yourkit.com/download/docker/YourKit-JavaProfiler-2023.9-docker.zip -P /tmp/ && \ | ||
# unzip /tmp/YourKit-JavaProfiler-2023.9-docker.zip -d /usr/local && \ | ||
|
||
ARG KEEPUP_VERSION=2.0.2 | ||
|
||
FROM itzg/minecraft-server:java21-alpine as minecraft | ||
LABEL org.opencontainers.image.authors="Offz <[email protected]>" | ||
RUN apk add --no-cache ansible-core rclone wget unzip jq openssh | ||
COPY --from=helper /keepup /usr/local | ||
ENV\ | ||
KEEPUP=true\ | ||
KEEPUP_ALLOW_OVERRIDES=true\ | ||
|
@@ -20,24 +28,37 @@ ENV\ | |
HOME=/data\ | ||
ANSIBLE_CONFIG=/server-config/ansible.cfg | ||
|
||
WORKDIR /opt/minecraft | ||
# Install ansible collections | ||
COPY config/ansible-requirements.yml /opt/ansible/requirements.yml | ||
RUN ansible-galaxy collection install -r /opt/ansible/requirements.yml -p /opt/ansible/collections \ | ||
&& rm /opt/ansible/requirements.yml | ||
|
||
# Install YourKit Java Profiler agents | ||
#RUN wget -q https://www.yourkit.com/download/docker/YourKit-JavaProfiler-2023.9-docker.zip -P /tmp/ && \ | ||
# unzip /tmp/YourKit-JavaProfiler-2023.9-docker.zip -d /usr/local && \ | ||
# rm /tmp/YourKit-JavaProfiler-2023.9-docker.zip | ||
# Copy over scripts | ||
COPY scripts/dev /scripts/dev | ||
RUN chmod +x /scripts/dev/* | ||
|
||
# Install keepup | ||
RUN wget -nv -q -O keepup.zip https://github.com/MineInAbyss/Keepup/releases/download/v${KEEPUP_VERSION}/keepup-shadow-${KEEPUP_VERSION}.zip \ | ||
# unzip file inside hocon-to-json.zip into /usr/local \ | ||
&& unzip -q keepup.zip \ | ||
&& rclone copy keepup-shadow-${KEEPUP_VERSION}/ /usr/local \ | ||
&& chmod +x /usr/local/bin/keepup \ | ||
&& rm -rf keepup.zip keepup-shadow-${KEEPUP_VERSION} | ||
WORKDIR $HOME | ||
ENTRYPOINT ["/scripts/dev/entrypoint"] | ||
|
||
# Install ansible collections | ||
COPY config/ansible-requirements.yml /opt/ansible/requirements.yml | ||
|
||
FROM itzg/bungeecord as proxy | ||
LABEL org.opencontainers.image.authors="Offz <[email protected]>" | ||
RUN apt-get update -y \ | ||
&& apt-get install -y rsync rclone wget unzip git pipx python3-venv jq | ||
COPY --from=helper /keepup /usr/local | ||
ENV\ | ||
KEEPUP=true\ | ||
KEEPUP_ALLOW_OVERRIDES=true\ | ||
ANSIBLE=true\ | ||
ANSIBLE_PULL=true\ | ||
ANSIBLE_PULL_BRANCH=master\ | ||
SERVER_NAME=dev\ | ||
HOME=/server\ | ||
ANSIBLE_CONFIG=/server-config/ansible.cfg | ||
|
||
# Install ansible & collections | ||
RUN PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install ansible-core | ||
COPY config/ansible-requirements.yml /opt/ansible/requirements.yml | ||
RUN ansible-galaxy collection install -r /opt/ansible/requirements.yml -p /opt/ansible/collections \ | ||
&& rm /opt/ansible/requirements.yml | ||
|
||
|
@@ -46,5 +67,5 @@ COPY scripts/dev /scripts/dev | |
RUN chmod +x /scripts/dev/* | ||
|
||
WORKDIR $HOME | ||
|
||
RUN cp /usr/bin/run-bungeecord.sh /start | ||
ENTRYPOINT ["/scripts/dev/entrypoint"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters