Skip to content

Commit

Permalink
Fixed spigot build
Browse files Browse the repository at this point in the history
  • Loading branch information
nakira974 committed Aug 3, 2023
1 parent c11b753 commit 4aa80bc
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 31 deletions.
27 changes: 12 additions & 15 deletions 1.20.1/private/spigot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
# Use the official OpenJDK 17 image as base
FROM openjdk:17-jdk-alpine
FROM openjdk:19-jdk-alpine

# Define the working directory
WORKDIR /spigot-server

# Expose the necessary port
# Download BuildTools.jar to build spigot server
ADD https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar /temp/

# Install git & build spigot server
RUN apk add --no-cache git \
&& java -jar /temp/BuildTools.jar --rev latest \
&& mv spigot-*.jar spigot.jar \
&& rm -rf /temp

# Expose the necessary port
EXPOSE 25566

# Copy over server properties and world data
# Copy over server properties
COPY ./server.properties /spigot-server/
COPY ./whitelist.json /spigot-server/

Expand All @@ -16,20 +25,8 @@ COPY ./.map/world /spigot-server/world
COPY ./.map/world_nether /spigot-server/world_nether
COPY ./.map/world_the_end /spigot-server/world_the_end

# Copy EULA
COPY ./eula.txt /spigot-server/

# Accept Minecraft EULA
RUN echo "eula=true" > eula.txt

# Download BuildTools.jar to build spigot server
ADD https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar /temp/

# Install git & build spigot server
RUN apk add --no-cache git \
&& java -jar /temp/BuildTools.jar --rev latest \
&& mv spigot-*.jar spigot.jar \
&& rm -rf /temp

# Start the Spigot server
ENTRYPOINT ["java", "-Xmx1024M", "-Xms1024M", "-jar", "spigot.jar", "nogui"]
2 changes: 1 addition & 1 deletion 1.20.1/private/vanilla/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use the official OpenJDK 17 image as base
FROM openjdk:17-jdk-alpine
FROM openjdk:19-jdk-alpine

# Define the working directory
WORKDIR /minecraft-server
Expand Down
18 changes: 10 additions & 8 deletions 1.20.1/public/lavalawless.lkh.coffee/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# Use the official OpenJDK 17 image as base
FROM openjdk:17-jdk-alpine
FROM openjdk:19-jdk-alpine

# Define the working directory
WORKDIR /spigot-server

# Expose the necessary port
EXPOSE 25566

# Download BuildTools.jar to build spigot server
ADD https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar /temp/

# Install git & build spigot server
RUN apk add --no-cache git \
&& java -jar /temp/BuildTools.jar --rev latest \
&& mv spigot-*.jar spigot.jar \
&& rm -rf /temp \

# Copy over server properties and world data
COPY ./server.properties /spigot-server/
COPY blacklist.json /spigot-server/
Expand All @@ -22,14 +31,7 @@ COPY ./eula.txt /spigot-server/
# Accept Minecraft EULA
RUN echo "eula=true" > eula.txt

# Download BuildTools.jar to build spigot server
ADD https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar /temp/

# Install git & build spigot server
RUN apk add --no-cache git \
&& java -jar /temp/BuildTools.jar --rev latest \
&& mv spigot-*.jar spigot.jar \
&& rm -rf /temp

# Start the Spigot server
ENTRYPOINT ["java", "-Xmx1024M", "-Xms1024M", "-jar", "spigot.jar", "nogui"]
16 changes: 9 additions & 7 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ services:
# Private vanilla server
minecraft_vanilla_1_20_1:
build: ./1.20.1/private/vanilla
ports:
- '25565:25565'
volumes:
- './1.20.1/private/vanilla/.map/world:/minecraft-server/world'
- './1.20.1/private/vanilla/.map/world_nether:/minecraft-server/world_nether'
Expand All @@ -55,25 +53,29 @@ services:
networks:
private:
ipv4_address: 172.16.0.2
labels:
- "traefik.enable=true"
- "traefik.http.routers.lavalawless.rule=Host(`minecraft.vanilla.lkh.coffee`)"
- "traefik.http.services.lavalawless.loadbalancer.server.port=25565"

# Private Test Spigot server
minecraft_spygot_1_20_1:
build: ./1.20.1/private/spigot
ports:
- '25566:25566'
volumes:
- './1.20.1/spigot/private/.map/world:/minecraft-server/world'
- './1.20.1/spigot/private/.map/world_nether:/minecraft-server/world_nether'
- './1.20.1/spigot/private/.map/world_the_end:/minecraft-server/world_the_end'
networks:
private:
ipv4_address: 172.16.0.3
labels:
- "traefik.enable=true"
- "traefik.http.routers.lavalawless.rule=Host(`minecraft.spigot.lkh.coffee`)"
- "traefik.http.services.lavalawless.loadbalancer.server.port=25566"

# Public Spigot API server
lavalawless_vanilla_1_20_1:
build: ./1.20.1/public/lavalawless.lkh.coffee
ports:
- '25567:25567'
volumes:
- './1.20.1/public/lavalawless.lkh.coffee/.map/world:/minecraft-server/world'
- './1.20.1/public/lavalawless.lkh.coffee/.map/world_nether:/minecraft-server/world_nether'
Expand All @@ -85,5 +87,5 @@ services:

labels:
- "traefik.enable=true"
- "traefik.http.routers.lavalawless.rule=Host(`lavalawsless.lkh.coffee`)"
- "traefik.http.routers.lavalawless.rule=Host(`anarchy.lavalawsless.com`)"
- "traefik.http.services.lavalawless.loadbalancer.server.port=25567"

0 comments on commit 4aa80bc

Please sign in to comment.