LoupGarou/docker/Dockerfile
Thanh Tam-Tanguy TRAN cc75c0746f Allow to start the minecraft server from Docker (#5)
* feat(Docker): Dockerized minecraft application

* Fixed typo & Improvements in README.md

Co-authored-by: leomelki
2020-03-20 17:53:01 +01:00

30 lines
907 B
Docker

ARG SPIGOT_VERSION=1.15.1
# Build Loup-Garou project
FROM maven:3.3-jdk-8 as LOUP_GAROU_BUILDER
WORKDIR /app
COPY . .
RUN mvn clean install
RUN mvn package
# Build Spigot project
FROM openjdk:8 AS SPIGOT_BUILDER
ARG SPIGOT_VERSION
WORKDIR /spigot
RUN apt-get update
ADD https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar buildtools.jar
RUN git config --global --unset core.autocrlf || true
RUN java -jar buildtools.jar --rev ${SPIGOT_VERSION}
# Final server image
FROM openjdk:8
ARG SPIGOT_VERSION
WORKDIR /_minecraft
COPY --from=LOUP_GAROU_BUILDER /app/target/LoupGarou.jar ./plugins/
ADD https://github.com/dmulloy2/ProtocolLib/releases/download/4.5.0/ProtocolLib.jar ./plugins
COPY --from=SPIGOT_BUILDER /spigot/spigot-${SPIGOT_VERSION}.jar ./spigot.jar
VOLUME /minecraft
WORKDIR /minecraft
EXPOSE 25565
CMD cp -rn /_minecraft/* . && tail -f /dev/null