-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust a couple of things for docker hosting
- Loading branch information
1 parent
a74ed46
commit 0d1bee0
Showing
17 changed files
with
156 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,4 @@ buildNumber.properties | |
/wait.sh | ||
/conf/ | ||
.direnv | ||
data |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This dockerfile is far from best practice and is a pure "Make it work" approach. Please do not use it as a reference of any kind. | ||
FROM gradle:jdk21-alpine as build | ||
|
||
COPY . . | ||
RUN gradle clean build --no-daemon | ||
|
||
# We use a jammy image because we need some more stuff than alpine provides | ||
FROM eclipse-temurin:21-jammy as runtime | ||
|
||
WORKDIR /app | ||
RUN apt update | ||
# Make sure screen exists. | ||
RUN apt install -y screen | ||
|
||
# Setting up the bot | ||
COPY --from=build /home/gradle/bot/build/libs/bot-*-all.jar ./bot.jar | ||
RUN mkdir plugins | ||
RUN mkdir servers | ||
RUN mkdir template | ||
RUN mkdir template/plugins | ||
COPY docker/resources/bot/wait.sh . | ||
# Copy the plugin jam plugin into the template. | ||
COPY --from=build /home/gradle/plugin-paper/build/libs/plugin-paper-*-all.jar ./bot/template/plugins/pluginjam.jar | ||
|
||
COPY docker/resources/docker-entrypoint.sh . | ||
ENTRYPOINT ["bash", "docker-entrypoint.sh"] |
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
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
services: | ||
bot: | ||
image: ghcr.io/devcordde/plugin-jam-bot:latest | ||
volumes: | ||
- ./data/bot/config:/app/config | ||
- ./data/bot/plugins:/app/plugins | ||
- ./data/bot/servers:/app/servers | ||
- ./data/bot/template:/app/template | ||
velocity: | ||
image: itzg/mc-proxy:latest | ||
tty: true | ||
environment: | ||
EULA: "TRUE" | ||
TYPE: VELOCITY | ||
JVM_DD_OPTS: javalin.port=30000 | ||
volumes: | ||
- ./data/velocity/config:/config | ||
- ./data/velocity/plugins:/plugins | ||
lobby: | ||
image: itzg/minecraft-server:latest | ||
stdin_open: true | ||
tty: true | ||
environment: | ||
VERSION: 1.21 | ||
TYPE: PAPER | ||
MEMORY: 2G | ||
volumes: | ||
- ./data/lobby:/data |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
services: | ||
bot: | ||
build: . | ||
volumes: | ||
- ./data/bot/config:/app/config | ||
- ./data/bot/plugins:/app/plugins | ||
- ./data/bot/servers:/app/servers | ||
- ./data/bot/template:/app/template | ||
database: | ||
image: postgres:16 | ||
environment: | ||
POSTGRES_PASSWORD: postgres | ||
velocity: | ||
image: itzg/mc-proxy:latest | ||
tty: true | ||
environment: | ||
EULA: "TRUE" | ||
TYPE: VELOCITY | ||
JVM_DD_OPTS: javalin.port=30000 | ||
volumes: | ||
- ./data/velocity/config:/config | ||
- ./data/velocity/plugins:/plugins | ||
lobby: | ||
image: itzg/minecraft-server:latest | ||
stdin_open: true | ||
tty: true | ||
environment: | ||
VERSION: 1.21 | ||
TYPE: PAPER | ||
MEMORY: 2G | ||
volumes: | ||
- ./data/lobby:/data |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
|
||
# switch to config directory | ||
|
||
while true; do | ||
# Of course you can use any other executable file here. We use java. | ||
java \ | ||
-Xms256m \ | ||
-Xmx2048m \ | ||
-Dbot.config=config/config.json -Dlog4j.configurationFile=config/log4j2.xml -Dcjda.localisation.error.name=false -Dcjda.interactions.cleanguildcommands=true \ | ||
-jar ./bot.jar | ||
|
||
code=$? | ||
|
||
case $code in | ||
0) # proper shutdown | ||
echo "Performed proper shutdown, exiting restart loop" | ||
exit 0 | ||
;; | ||
10) # restart request | ||
echo "Requested to restart" | ||
continue | ||
;; | ||
*) # Recovering | ||
echo "Unknown exit code, attempting recovery restart in a few seconds" | ||
sleep 2 | ||
continue | ||
;; | ||
esac | ||
done |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
java -Xms256m -Xmx2048m -Dbot.config=config/config.json -Dlog4j.configurationFile=config/log4j2.xml -Dcjda.localisation.error.name=false -Dcjda.interactions.cleanguildcommands=true -jar ./bot.jar |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env sh | ||
while screen -ls | grep -q "$1" | ||
do | ||
sleep 1 | ||
echo "wait" | ||
done | ||
sleep 1 |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
java -Xms256m -Xmx2048m -Dbot.config=config/config.json -Dlog4j.configurationFile=config/log4j2.xml -Dcjda.localisation.error.name=false -Dcjda.interactions.cleanguildcommands=true -jar ./bot.jar |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
screen -dmS lobby java -Xms1G -Xmx1G -Dcom.mojang.eula.agree=true -jar server.jar --nogui |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
screen -dmS velocity java -Djavalin.port="29999" -jar velocity.jar |
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
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