Add build flow to Dockerfile, rename Dockerfile to Dockerfile.server, Add sample compose.yml, tweak DEDICATED_SERVER.md to reflect new reality

This commit is contained in:
dimaguy 2023-12-01 13:15:57 +00:00
parent 97b46ad01a
commit 25d1ec1789
5 changed files with 58 additions and 22 deletions

1
.gitignore vendored
View File

@ -12,3 +12,4 @@
/*.AppImage
/core*
/qemu_*
/data

View File

@ -1,19 +0,0 @@
FROM debian:bullseye-slim
# Install
RUN \
apt-get update && \
apt-get install -y tini qemu-user && \
apt-get --fix-broken install -y && \
rm -rf /var/lib/apt/lists/*
# Copy
ADD ./out/server-amd64 /app
# Setup Working Directory
RUN mkdir /data
WORKDIR /data
# Setup Entrypoint
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["/app/usr/bin/minecraft-pi-reborn-server"]

30
Dockerfile.server Normal file
View File

@ -0,0 +1,30 @@
FROM debian:buster as builder
ADD . .
RUN echo 'deb http://deb.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/backports.list && apt-get update && apt-get install --no-install-recommends -y -t buster-backports cmake dpkg-dev wget
RUN ./scripts/install-dependencies.sh
ARG TARGETARCH
#Build
#If build fails past this stage, you're probably missing the repository submodules
RUN ./scripts/setup.sh server $TARGETARCH
RUN ./scripts/build.sh server $TARGETARCH
FROM debian:bullseye-slim as runtime
# Install
RUN \
apt-get update && \
apt-get install -y tini qemu-user && \
apt-get --fix-broken install -y && \
rm -rf /var/lib/apt/lists/*
ARG TARGETARCH
# Copy
COPY --from=builder ./out/server-$TARGETARCH /app
# Setup Working Directory
RUN mkdir /data
WORKDIR /data
EXPOSE 19132/udp
# Setup Entrypoint
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["/app/usr/bin/minecraft-pi-reborn-server"]

23
compose.yml Normal file
View File

@ -0,0 +1,23 @@
name: minecraft-pi-reborn
services:
server:
build:
context: .
dockerfile: Dockerfile.server
image: thebrokenrail/minecraft-pi-reborn-server
networks:
default: null
ports:
- mode: ingress
target: 19132
published: "19132"
protocol: udp
volumes:
- type: bind
source: ./data
target: /data
bind:
create_host_path: true
networks:
default:
name: minecraft-pi-reborn_default

View File

@ -9,11 +9,12 @@ This server is also compatible with MCPE Alpha v0.6.1[^1].
To use, install and run ``minecraft-pi-reborn-server``. It will generate the world and ``server.properties`` in the current directory.
### Docker Image
An official Docker image is also provided: [thebrokenrail/minecraft-pi-reborn-server](https://hub.docker.com/r/thebrokenrail/minecraft-pi-reborn-server).
~~An official Docker image is also provided: [thebrokenrail/minecraft-pi-reborn-server](https://hub.docker.com/r/thebrokenrail/minecraft-pi-reborn-server).~~
Use the provided Dockerfile.server at the root, there's a sample compose.yml file you can use with ``docker compose``
## Server Limitations
* Player data is not saved because of limitations with MCPE LAN worlds
* An easy workaround is to place your inventory in a chest before logging off
* Player data is not saved because of limitations with MCPE LAN worlds (This means player position and inventory are both reset)
* An easy workaround is to place your inventory in an easily reachable chest before logging off
* Survival Mode servers are incompatible with unmodded MCPI
[^1]: The exception to this is buckets, those will crash MCPE players.