From d2c2dd54e4f013acc5535659c82e529423647fdd Mon Sep 17 00:00:00 2001 From: James Edington Date: Tue, 26 Jan 2021 16:29:40 -0700 Subject: [PATCH] Add Dockerfile for standalone use Example usage: docker build -t geyser -f standalone.Dockerfile https://github.com/GeyserMC/Geyser.git docker run -p 19132:19132/udp -v `pwd`/geyser:/var/lib/geyser geyser --- .dockerignore | 2 ++ standalone.Dockerfile | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 .dockerignore create mode 100644 standalone.Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..6ae9fa628 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.dockerignore +*Dockerfile diff --git a/standalone.Dockerfile b/standalone.Dockerfile new file mode 100644 index 000000000..6b29e356f --- /dev/null +++ b/standalone.Dockerfile @@ -0,0 +1,22 @@ +FROM maven:3.6-jdk-11 as build + +COPY . . + +RUN git submodule update --init --recursive&&\ + mvn clean install + +FROM adoptopenjdk/openjdk11:alpine-jre + +COPY --from=build ./bootstrap/standalone/target /opt/Geyser + +ARG UID=1000 +ARG GID=1000 +RUN adduser --system --shell /bin/false -u $UID -g $GID --home /opt/Geyser geyser + +RUN mkdir -v /var/lib/geyser && chown -v -R ${UID}:0 /var/lib/geyser +VOLUME /var/lib/geyser + +USER geyser +WORKDIR /var/lib/geyser +EXPOSE 19132/udp +CMD ["java", "-jar", "/opt/Geyser/Geyser.jar"]