-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Docker configuration, update README with instructions. (#413)
- Loading branch information
1 parent
3b5b433
commit ba700c1
Showing
5 changed files
with
93 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Jenkinsfile | ||
circle.yml | ||
README.md | ||
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 |
---|---|---|
|
@@ -52,3 +52,7 @@ resource_packs | |
resource_packs/* | ||
creativeitems.json | ||
recipes.json | ||
|
||
#Nukkit data dir | ||
data | ||
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,51 @@ | ||
# This Dockerfile uses Docker Multi-Stage Builds | ||
# See https://docs.docker.com/engine/userguide/eng-image/multistage-build/ | ||
# Requires Docker v17.05 | ||
|
||
# Use OpenJDK JDK image for intermiediate build | ||
FROM openjdk:8-jdk-slim AS build | ||
|
||
# Install packages required for build | ||
RUN apt update && apt install -y \ | ||
build-essential \ | ||
git \ | ||
maven | ||
|
||
# Build from source and create artifact | ||
WORKDIR /src | ||
COPY ./ /src | ||
RUN git submodule update --init | ||
RUN mvn clean package | ||
|
||
# Use OpenJDK JRE image for runtime | ||
FROM openjdk:8-jre-slim AS run | ||
LABEL maintainer="Micheal Waltz <dockerfiles@ecliptik.com>" | ||
|
||
# Copy artifact from build image | ||
COPY --from=build /src/target/nukkit-1.0-SNAPSHOT.jar /app/nukkit.jar | ||
|
||
# Create minecraft user | ||
RUN useradd --user-group \ | ||
--no-create-home \ | ||
--home-dir /data \ | ||
--shell /usr/sbin/nologin \ | ||
minecraft | ||
|
||
# Volumes | ||
VOLUME /data /home/minecraft | ||
|
||
# Ports | ||
EXPOSE 19132 | ||
|
||
# Make app owned by minecraft user | ||
RUN chown -R minecraft:minecraft /app | ||
|
||
# User and group to run as | ||
USER minecraft:minecraft | ||
|
||
# Set runtime workdir | ||
WORKDIR /data | ||
|
||
# Run app | ||
ENTRYPOINT ["java"] | ||
CMD [ "-jar", "/app/nukkit.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: '3' | ||
services: | ||
nukkit: | ||
build: ./ | ||
ports: | ||
- "19132:19132" | ||
- "19132:19132/udp" | ||
volumes: | ||
- ./data:/data | ||
stdin_open: true | ||
tty: true |