MinecraftConsoles/docker/dedicated-server/Dockerfile
2026-03-27 10:00:41 +03:00

73 lines
2.2 KiB
Docker

FROM debian:trixie-slim
ARG DEBIAN_FRONTEND=noninteractive
# basically, it only works with a Release build.(libs are not included in Debug build)
ARG MC_RUNTIME_DIR=srv/mc
ENV PROTONPATH=GE-Proton
ENV PROTON_ENABLE_WAYLAND=1
ENV WINEARCH=win64
ENV WINEPREFIX=/var/opt/wineprefix64
RUN dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
xwayland-run \
cage \
curl \
tini \
unzip \
&& rm -rf /var/lib/apt/lists/*
# Wine from the upstream repo
RUN mkdir -pm755 /etc/apt/keyrings && \
curl -fsSL https://dl.winehq.org/wine-builds/winehq.key \
-o /etc/apt/keyrings/winehq-archive.key && \
curl -fsSL https://dl.winehq.org/wine-builds/debian/dists/trixie/winehq-trixie.sources \
-o /etc/apt/sources.list.d/winehq-trixie.sources && \
apt-get update && \
apt-get install -y --install-recommends winehq-devel
# UMU
RUN set -eux; \
ver="$( \
curl -sIL https://github.com/Open-Wine-Components/umu-launcher/releases/latest \
| grep -i '^location:' \
| sed -E 's|.*tag/||' \
| tr -d '\r' \
)"; \
curl -Lo /tmp/umu-launcher.deb \
"https://github.com/Open-Wine-Components/umu-launcher/releases/download/${ver}/python3-umu-launcher_${ver}-1_amd64_debian-13.deb"; \
apt-get install -y /tmp/umu-launcher.deb; \
rm -f /tmp/umu-launcher.deb;
# Create user
RUN useradd -m -s /bin/bash mclce
# Give maxima sudo without password
RUN echo "maxima ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/mclce \
&& chmod 0440 /etc/sudoers.d/mclce
USER mclce
# games dir
RUN sudo chmod 0755 /srv/mc && \
sudo chmod 0755 /srv/persist
# latest server build
RUN curl -Lo /tmp/LCEServerWindows64.zip \
"https://github.com/smartcmd/MinecraftConsoles/releases/download/nightly-dedicated-server/LCEServerWindows64.zip" \
&& unzip /tmp/LCEServerWindows64.zip -d /srv/mc \
&& rm /tmp/LCEServerWindows64.zip
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod 0755 /usr/local/bin/entrypoint.sh \
&& mkdir -p /var/opt/wineprefix64 /srv/mc \
&& test -f /srv/mc/Minecraft.Server.exe
WORKDIR /srv/mc
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/entrypoint.sh"]