Create Dockerfile
Browse files- Dockerfile +37 -0
Dockerfile
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ubuntu:22.04
|
| 2 |
+
|
| 3 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
+
|
| 5 |
+
# Install curl, unzip, python3, and Bedrock dependencies
|
| 6 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
+
curl \
|
| 8 |
+
unzip \
|
| 9 |
+
ca-certificates \
|
| 10 |
+
python3 \
|
| 11 |
+
libcurl4 \
|
| 12 |
+
libssl3 \
|
| 13 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
+
|
| 15 |
+
# Download playit-cli standalone binary
|
| 16 |
+
RUN curl -Lo /usr/local/bin/playit https://github.com/playit-cloud/playit-agent/releases/latest/download/playit-linux-amd64 \
|
| 17 |
+
&& chmod +x /usr/local/bin/playit
|
| 18 |
+
|
| 19 |
+
WORKDIR /bedrock
|
| 20 |
+
|
| 21 |
+
# Download latest official Bedrock Dedicated Server (BDS)
|
| 22 |
+
RUN USER_AGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64)" \
|
| 23 |
+
&& BDS_URL=$(curl -s -H "User-Agent: $USER_AGENT" https://www.minecraft.net/en-us/download/server/bedrock | grep -o 'https://minecraft.azureedge.net/bin-linux/bedrock-server-[0-9\.]*\.zip' | head -n 1) \
|
| 24 |
+
&& echo "Downloading from: $BDS_URL" \
|
| 25 |
+
&& curl -H "User-Agent: $USER_AGENT" -Lo bedrock-server.zip "$BDS_URL" \
|
| 26 |
+
&& unzip bedrock-server.zip \
|
| 27 |
+
&& rm bedrock-server.zip \
|
| 28 |
+
&& chmod +x bedrock_server
|
| 29 |
+
|
| 30 |
+
# Copy startup scripts and web console
|
| 31 |
+
COPY app.py /bedrock/app.py
|
| 32 |
+
COPY start.sh /bedrock/start.sh
|
| 33 |
+
RUN chmod +x /bedrock/start.sh
|
| 34 |
+
|
| 35 |
+
EXPOSE 7860
|
| 36 |
+
|
| 37 |
+
CMD ["/bedrock/start.sh"]
|