From a06030332abd82abd646b2c5397e6348b938b038 Mon Sep 17 00:00:00 2001 From: Bram Date: Sat, 31 Jul 2021 15:28:26 +0200 Subject: [PATCH] Add Docker example --- Dockerfile | 19 +++++++++++++++++++ start.sh | 12 ++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 Dockerfile create mode 100644 start.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b77b5e0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM openjdk:slim +COPY --from=python:3 / / + +WORKDIR /usr/src/app + +# Prepare Minecraft - Matrix bridge +COPY requirements.txt ./ +RUN pip install --no-cache-dir -r requirements.txt + +# Prepare MC server +COPY server.jar ./ +RUN java -jar server.jar --nogui + +COPY . . + +# Buffer Python's stdout for debugging during runtime +ENV PYTHONUNBUFFERED=1 + +CMD ["python", "main.py", "java", "-Xmx1024M", "-Xms1024M", "-jar", "server.jar", "nogui"] diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..9109dcb --- /dev/null +++ b/start.sh @@ -0,0 +1,12 @@ +sudo docker run \ +-p 25565:25565 \ +-v "":/usr/src/app/world \ +-e EULA=true \ +-e WHITELIST=false \ +-e VERIFY_ACCOUNTS=true \ +-e MATRIX_HOMESERVER='' \ +-e MATRIX_USERNAME='' \ +-e MATRIX_PASSWORD='' \ +-e MC_CHANNEL='' \ +-e SERVER_ADDRESS='' \ +mc-bridge \ No newline at end of file