Skip to content

Instantly share code, notes, and snippets.

@havarnov
Created January 16, 2024 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save havarnov/ebfc4d5bd5c52eaa5a4beda0f78b4230 to your computer and use it in GitHub Desktop.
Save havarnov/ebfc4d5bd5c52eaa5a4beda0f78b4230 to your computer and use it in GitHub Desktop.
Minecraft Bedrock - fly.io
========= run.sh ==========
#!/bin/bash
socat UDP4-LISTEN:23191,fork,reuseaddr,bind=fly-global-services UDP4:127.0.0.1:19132 &
/opt/bedrock-entry.sh &
# Wait for any process to exit
wait -n
# Exit with status of process that exited first
exit $?
======= Dockerfile ========
FROM itzg/minecraft-bedrock-server:latest
RUN apt update
RUN apt -y install socat
COPY ./run.sh ./run.sh
RUN chmod +x ./run.sh
ENTRYPOINT ["./run.sh"]
========= fly.toml ========
app = "<APPNAME>"
primary_region = "ams"
kill_signal = "SIGINT"
kill_timeout = "5s"
[env]
EULA = "TRUE"
GAMEMODE = "creative"
[[services]]
internal_port = 23191
protocol = "udp"
[[services.ports]]
port = "23191"
[services.concurrency]
type = "connections"
hard_limit = 25
soft_limit = 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment