File size: 3,603 Bytes
722781c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive \
    PLAYIT_HOME=/data/playit_gg \
    SECRET_KEY="" \
    MC_DIR=/data/bedrock-server \
    SCRIPTS_DIR=/data/scripts \
    LOG_DIR=/data/logs

# ── System packages ───────────────────────────────────────────────────
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    curl wget unzip \
    libcurl4 libssl3 ca-certificates \
    uuid-runtime nano tar gzip \
    python3 python3-pip \
    cron git \
    && rm -rf /var/lib/apt/lists/*

# ── Python dependencies ───────────────────────────────────────────────
RUN pip install --no-cache-dir \
    google-api-python-client \
    google-auth-httplib2 \
    google-auth-oauthlib

# ── Directory structure ───────────────────────────────────────────────
RUN mkdir -p \
    /data/bedrock-server/worlds \
    /data/bedrock-server/backups \
    /data/playit_gg \
    /data/scripts \
    /data/logs

WORKDIR /data/bedrock-server

# ── Download Minecraft Bedrock server directly (no scraping) ─────────
RUN curl -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" \
    -o /tmp/bedrock-server.zip \
    "https://www.minecraft.net/bedrockdedicatedserver/bin-linux-preview/bedrock-server-1.26.20.28.zip" && \
    unzip /tmp/bedrock-server.zip -d /data/bedrock-server && \
    rm /tmp/bedrock-server.zip && \
    chmod +x /data/bedrock-server/bedrock_server

# ── Install playit agent ──────────────────────────────────────────────
RUN curl -L \
    -o /usr/local/bin/playit \
    "https://github.com/playit-cloud/playit-agent/releases/latest/download/playit-linux-amd64" && \
    chmod +x /usr/local/bin/playit

# ── Server config files ───────────────────────────────────────────────
COPY server.properties allowlist.json permissions.json ./

# ── Main startup scripts ──────────────────────────────────────────────
COPY start.sh run.sh status_server.py ./

# ── Utility / maintenance scripts ────────────────────────────────────
COPY backup.sh /data/scripts/backup.sh
COPY auto_restart.sh /data/scripts/auto_restart.sh
COPY health_check.sh /data/scripts/health_check.sh
COPY monitor.sh /data/scripts/monitor.sh
COPY google_drive_backup.py /data/scripts/google_drive_backup.py

# ── Cron schedule ─────────────────────────────────────────────────────
COPY crontab.txt /data/crontab.txt

# ── Permissions ───────────────────────────────────────────────────────
RUN chmod +x \
    /data/bedrock-server/start.sh \
    /data/bedrock-server/run.sh \
    /data/scripts/*.sh

# 7860 = HuggingFace keepalive + status dashboard
# 19132/19133 = Minecraft Bedrock UDP (tunneled via playit.gg)
EXPOSE 7860 19132/udp 19133/udp

USER root
CMD ["bash", "/data/bedrock-server/start.sh"]