Files
MSCO-Dedicated-Server/Dockerfile
T
MrMahoandClaude Opus 5.5 1ab9a01efb Server updates from the web panel with progress screen
- Updater checks git.mbm.wtf every 6 h (and on demand) for a newer <Version>
  on main, shows the new commits and the required mod version
- Install: download the source, build it with dotnet publish into
  data/app/current, warn players and restart (exit code 75 for Docker/systemd,
  self-relaunch on Windows). At startup a newer installed update is loaded in
  its own AssemblyLoadContext; after 3 failed starts the built-in version runs
- Panel: Update page, sidebar badge, full-screen progress overlay (download,
  build, install, restart) that survives the restart and reloads the panel
- Panel sessions survive restarts (hashed tokens in data/panel_sessions.json)
- Docker image is based on the .NET SDK so it can build updates
- Version 2.9.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 21:07:09 +02:00

28 lines
1.1 KiB
Docker

# MSCO dedizierter Server
# docker build -t msco-server MSCO.Server
# docker run -it -p 7777:7777 -v msco-server-data:/data msco-server
# Daten (server.json, save/, world.json) liegen im Volume /data.
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY . .
RUN dotnet publish -c Release -o /app
# sdk (enthält auch ASP.NET/Kestrel fürs Web-Panel): damit sich der Server im Panel selbst updaten kann
# (lädt den Quellcode, baut ihn und legt ihn nach /data/app)
FROM mcr.microsoft.com/dotnet/sdk:10.0
WORKDIR /app
COPY --from=build /app .
ENV MSCO_DATA=/data
# läuft als beliebige Benutzer-ID (docker compose "user:") - dann gibt es kein eigenes Home
ENV HOME=/tmp
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 DOTNET_NOLOGO=1
# Befehle an den laufenden Server: docker exec msco-server msco players
RUN printf '#!/bin/sh\nexec dotnet /app/MSCO.Server.dll --cmd "$@"\n' > /usr/local/bin/msco && chmod +x /usr/local/bin/msco
VOLUME /data
# Spiel UND Web-Panel (Browser werden am selben Port erkannt)
EXPOSE 7777/tcp
# docker stop schickt SIGTERM -> Server speichert den Weltzustand
STOPSIGNAL SIGTERM
ENTRYPOINT ["dotnet", "MSCO.Server.dll"]