Map NetherNet properties and fix healthcheck (#675)
* Map NetherNet properties and add a TCP-aware healthcheck. TRANSPORT/SERVER_UDP_PORTS/SERVER_IP were ignored; latest BDS also fails the RakNet healthcheck. Leave TRANSPORT unset so pinned RakNet versions keep zip defaults. * Drop the README hedge about client verification of SERVER_UDP_PORTS.
This commit is contained in:
1 parent
43e5ef3607
commit
71fbc302b4
5 files changed
+57
-1
No files matched your search
+2
-1
@@ -11,6 +11,7 @@ RUN --mount=target=/build,source=build /build/install-packages
|
||||
ARG BOX64_PACKAGE=box64
|
||||
RUN --mount=target=/build,source=build BOX64_PACKAGE=$BOX64_PACKAGE /build/setup-arm64
|
||||
|
||||
EXPOSE 19132/tcp
|
||||
EXPOSE 19132/udp
|
||||
EXPOSE 19133/udp
|
||||
|
||||
@@ -74,7 +75,7 @@ ENV VERSION=LATEST \
|
||||
SERVER_PORT_V6=19133 \
|
||||
ENABLE_BDS_V6BIND_FIX=false
|
||||
|
||||
HEALTHCHECK --start-period=1m CMD /usr/local/bin/mc-monitor status-bedrock --host 127.0.0.1 --port $SERVER_PORT
|
||||
HEALTHCHECK --start-period=1m CMD /usr/local/bin/bds-healthcheck
|
||||
|
||||
ARG BUILDTIME=local
|
||||
ARG VERSION=local
|
||||
|
||||
@@ -19,6 +19,8 @@ If your network is dual-stack (IPv4 and IPv6), also map the IPv6 port: `-p 19132
|
||||
|
||||
Alternatively, enable `ENABLE_BDS_V6BIND_FIX=true` to serve both from the same port number - see [IPv6 same-port fix](#ipv6-same-port-fix).
|
||||
|
||||
For `TRANSPORT=nethernet`, see [NetherNet](#nethernet).
|
||||
|
||||
## Upgrading to the latest Bedrock server version
|
||||
|
||||
With the `VERSION` variable set to "LATEST", which is the default, then the Bedrock server can be upgraded by restarting the container. At every startup, the container checks for the latest version and upgrades, if needed.
|
||||
@@ -94,6 +96,9 @@ Typically, each property is configured instead by the UPPER_SNAKE_CASE equivalen
|
||||
- `ALLOW_LIST`
|
||||
- `SERVER_PORT`
|
||||
- `SERVER_PORT_V6`
|
||||
- `SERVER_IP`
|
||||
- `SERVER_UDP_PORTS`
|
||||
- `TRANSPORT`
|
||||
- `ENABLE_LAN_VISIBILITY`
|
||||
- `VIEW_DISTANCE`
|
||||
- `TICK_DISTANCE`
|
||||
@@ -157,9 +162,18 @@ docker run -d -it --name bds-flat-creative \
|
||||
|
||||
- **UDP** 19132 : the Bedrock server port for IPv4 clients, set by `SERVER_PORT`
|
||||
- **UDP** 19133 : the default Bedrock server port for IPv6 clients, set by `SERVER_PORT_V6`
|
||||
- **TCP** 19132 : also `EXPOSE`d; used when `TRANSPORT=nethernet`
|
||||
|
||||
> **NOTE**: with `ENABLE_BDS_V6BIND_FIX=true`, both ports can be set to the same value (e.g. 19132), exposing the same port number for both address families - this is recommended for dual-stack environments to avoid connectivity problems.
|
||||
|
||||
## NetherNet
|
||||
|
||||
`TRANSPORT`, `SERVER_UDP_PORTS`, and `SERVER_IP` are mapped into `server.properties` the same way as the other keys on this list.
|
||||
|
||||
When `TRANSPORT=nethernet`, the image healthcheck is `GET http://127.0.0.1:$SERVER_PORT/v1/join`. Otherwise it still runs `mc-monitor status-bedrock` on `$SERVER_PORT`.
|
||||
|
||||
[examples/nethernet/compose.yml](examples/nethernet/compose.yml) sets `TRANSPORT=nethernet` and publishes `19132/tcp` plus UDP `19140-19155`. `SERVER_UDP_PORTS` values are those documented in the BDS `server.properties` comments. LAN discovery (UDP 7551) was not tested.
|
||||
|
||||
## IPv6 same-port fix
|
||||
|
||||
BDS binds IPv4 and IPv6 on separate ports by default (19132 and 19133).
|
||||
@@ -371,6 +385,8 @@ The [examples](examples) directory contains [an example Docker compose file](exa
|
||||
- a service running the bedrock server container and exposing UDP ports 19132 (IPv4) and 19133 (IPv6). In the example is named "bds", short for "Bedrock Dedicated Server", but you can name the service whatever you want
|
||||
- a volume attached to the service at the container path `/data`
|
||||
|
||||
For `TRANSPORT=nethernet`, see [examples/nethernet/compose.yml](examples/nethernet/compose.yml).
|
||||
|
||||
```yaml
|
||||
services:
|
||||
bds:
|
||||
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Only probe NetherNet HTTP when the user asked for it. Otherwise RakNet UDP
|
||||
# via mc-monitor — including unset TRANSPORT and older VERSION= pins.
|
||||
SERVER_PORT="${SERVER_PORT:-19132}"
|
||||
|
||||
if [[ "${TRANSPORT,,}" == "nethernet" ]]; then
|
||||
exec curl -fsS -o /dev/null --max-time 5 "http://127.0.0.1:${SERVER_PORT}/v1/join"
|
||||
fi
|
||||
|
||||
exec mc-monitor status-bedrock --host 127.0.0.1 --port "$SERVER_PORT"
|
||||
@@ -0,0 +1,18 @@
|
||||
services:
|
||||
bds:
|
||||
image: itzg/minecraft-bedrock-server
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
TRANSPORT: "nethernet"
|
||||
# Bind-only (network_mode: host, or when BDS already listens on a reachable address):
|
||||
# SERVER_UDP_PORTS: "19140-19155"
|
||||
# Advertised mapping behind Docker bridge / extra NAT: <reachable-ip>:external-udp:internal-udp
|
||||
# (IPv4 or IPv6 literal, not a hostname)
|
||||
# SERVER_UDP_PORTS: "<reachable-ip>:19140-19155:19140-19155"
|
||||
ports:
|
||||
- "19132:19132/tcp"
|
||||
- "19140-19155:19140-19155/udp"
|
||||
volumes:
|
||||
- ./data:/data
|
||||
stdin_open: true
|
||||
tty: true
|
||||
@@ -51,6 +51,16 @@
|
||||
"server-portv6": {
|
||||
"env": "SERVER_PORT_V6"
|
||||
},
|
||||
"server-ip": {
|
||||
"env": "SERVER_IP"
|
||||
},
|
||||
"server-udp-ports": {
|
||||
"env": "SERVER_UDP_PORTS"
|
||||
},
|
||||
"transport": {
|
||||
"env": "TRANSPORT",
|
||||
"allowed": ["raknet", "nethernet"]
|
||||
},
|
||||
"enable-lan-visibility": {
|
||||
"env": "ENABLE_LAN_VISIBILITY",
|
||||
"allowed": ["true", "false"]
|
||||
|
||||
Reference in new issue
Block a user