diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 26bc034..0000000 --- a/Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ -# Java Version -ARG JAVA_VERSION=8 - -FROM openjdk:${JAVA_VERSION} AS build - -ARG PAPER_VERSION=1.13.2 -ARG PAPER_DOWNLOAD_URL=https://papermc.io/api/v1/paper/${PAPER_VERSION}/latest/download -ARG MINECRAFT_BUILD_USER=minecraft-build -ENV MINECRAFT_BUILD_PATH=/opt/minecraft - -WORKDIR ${MINECRAFT_BUILD_PATH} - -ADD ${PAPER_DOWNLOAD_URL} paper.jar - -RUN useradd -ms /bin/bash ${MINECRAFT_BUILD_USER} && \ - chown ${MINECRAFT_BUILD_USER} ${MINECRAFT_BUILD_PATH} -R - -USER ${MINECRAFT_BUILD_USER} - -RUN java -jar ${MINECRAFT_BUILD_PATH}/paper.jar; exit 0 - -RUN mv ${MINECRAFT_BUILD_PATH}/cache/patched*.jar ${MINECRAFT_BUILD_PATH}/paper.jar - -FROM openjdk:${JAVA_VERSION} AS runtime - -ENV MINECRAFT_PATH=/opt/minecraft - -WORKDIR ${MINECRAFT_PATH} - -COPY --from=build /opt/minecraft/paper.jar ${MINECRAFT_PATH}/ - -RUN addgroup minecraft && \ - useradd -ms /bin/bash minecraft -g minecraft -d ${MINECRAFT_PATH} && \ - mkdir ${MINECRAFT_PATH}/plugins && \ - mkdir ${MINECRAFT_PATH}/worlds && \ - chown -R minecraft:minecraft ${MINECRAFT_PATH} - -USER minecraft - -VOLUME "${MINECRAFT_PATH}/plugins" -VOLUME "${MINECRAFT_PATH}/worlds" - -EXPOSE 25565 - -ENTRYPOINT java -Xmx4G -server -Dcom.mojang.eula.agree=true \ - -jar ${MINECRAFT_PATH}/paper.jar \ - --world-dir=${MINECRAFT_PATH}/worlds \ - --nojline diff --git a/docker-compose.yml b/docker-compose.yml index c06aed0..07f52c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,14 +1,11 @@ -version: '3.7' - +version: '2.4' services: - mcserver: - container_name: 'mcserver' - image: 'mcserver' - build: - context: . - dockerfile: Dockerfile - ports: - - "25565:25565" + niscore-build: + container_name: niscore-build + image: adoptopenjdk/openjdk16 + working_dir: /opt/build + entrypoint: bash -c "chmod +x ./gradlew && ./gradlew clean build" + environment: + GRADLE_USER_HOME: /opt/build/.gradle/caches volumes: - - ./mcserver/plugins:/opt/minecraft/plugins - - ./mcserver/worlds:/opt/minecraft/worlds + - .:/opt/build:Z \ No newline at end of file