Skip to content

Commit

Permalink
Added Dockerfile.dynmap & compose-dynmap.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dmccoystephenson committed Jan 20, 2024
1 parent 10cc865 commit 904079f
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ RUN echo "eula=true" > eula.txt
RUN mkdir plugins

# Build plugin
COPY . .
RUN ./gradlew build
RUN cp build/libs/*-all.jar plugins
COPY . /testmcserver/MedievalFactions
WORKDIR /testmcserver/MedievalFactions
RUN /testmcserver/MedievalFactions/gradlew build
WORKDIR /testmcserver

# Install plugin
RUN cp /testmcserver/MedievalFactions/build/libs/*-all.jar /testmcserver/plugins

# Run server
EXPOSE 25565
EXPOSE 8123
ENTRYPOINT java -jar spigot-1.20.4.jar
41 changes: 41 additions & 0 deletions Dockerfile.dynmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM ubuntu

# Install dependencies
RUN apt-get update
RUN apt-get install -y git \
openjdk-17-jdk \
openjdk-17-jre \
wget \
git

# Create server directory
WORKDIR /testmcserver

# Clone & build dynmap (placed here to take advantage of docker caching)
RUN git clone https://github.com/webbukkit/dynmap
WORKDIR /testmcserver/dynmap
RUN /testmcserver/dynmap/gradlew :spigot:build
WORKDIR /testmcserver

# Build server
RUN wget -O BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
RUN git config --global --unset core.autocrlf || :
RUN java -jar BuildTools.jar --rev 1.20.4
RUN echo "eula=true" > eula.txt
RUN mkdir plugins

# Build plugin
COPY . /testmcserver/MedievalFactions
WORKDIR /testmcserver/MedievalFactions
RUN /testmcserver/MedievalFactions/gradlew build
WORKDIR /testmcserver

# Install plugin
RUN cp /testmcserver/MedievalFactions/build/libs/*-all.jar /testmcserver/plugins

# Install dynmap
RUN cp /testmcserver/dynmap/target/Dynmap-*.jar /testmcserver/plugins

# Run server
EXPOSE 25565
ENTRYPOINT java -jar spigot-1.20.4.jar
10 changes: 10 additions & 0 deletions compose-dynmap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
testmcserver:
build:
context: .
dockerfile: Dockerfile.dynmap
image: mf-test-mc-server-with-dynmap
container_name: mf-test-mc-server-with-dynmap
ports:
- "25565:25565"
- "8123:8123"

0 comments on commit 904079f

Please sign in to comment.