Files
minecraft/dashboard/Dockerfile
T
Aryan SinghandClaude Fable 5 279d137ce5 Minecraft 26.2 Fabric server stack with CraftDeck management panel
- docker-compose: itzg/minecraft-server (Fabric, offline mode, whitelist
  enforced, Modrinth-managed mods), itzg/mc-backup sidecar, custom dashboard
- Gated auth for offline mode: approve username -> whitelisted with a short
  registration window -> EasyAuth /register + /login; auto-revoke on expiry
- CraftDeck panel (Next.js 16, zero native deps): live console (SSE), players
  & stats, lag diagnostics (server TPS vs player ping via spark), performance
  graphs, Modrinth mod search/manager, backups & restore, sandboxed file
  browser/editor, .env config editor with compose apply, cron schedules,
  Discord alerts, scrypt-hashed panel login
- scripts/setup.sh generates secrets; docs/ covers auth, mods, updating,
  backups, networking (Tailscale), troubleshooting

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 11:07:07 -05:00

57 lines
1.9 KiB
Docker

# syntax=docker/dockerfile:1
FROM node:26-slim AS deps
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
FROM node:26-slim AS build
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build
FROM node:26-slim AS runtime
ARG TARGETARCH=amd64
ARG DOCKER_CLI_VERSION=27.5.1
ARG COMPOSE_VERSION=v2.32.4
# unzip: mod jar metadata · tar/gzip: backup restore · curl: healthcheck + installs
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl unzip tar gzip \
&& rm -rf /var/lib/apt/lists/*
# Docker CLI + compose plugin so the panel can recreate containers after
# config changes (the socket is mounted by docker-compose.yml).
RUN set -eux; \
case "${TARGETARCH}" in \
arm64) arch=aarch64 ;; \
*) arch=x86_64 ;; \
esac; \
curl -fsSL "https://download.docker.com/linux/static/stable/${arch}/docker-${DOCKER_CLI_VERSION}.tgz" \
| tar -xz --strip-components=1 -C /usr/local/bin docker/docker; \
mkdir -p /usr/local/lib/docker/cli-plugins; \
curl -fsSL -o /usr/local/lib/docker/cli-plugins/docker-compose \
"https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-linux-${arch}"; \
chmod +x /usr/local/lib/docker/cli-plugins/docker-compose; \
docker --version; docker compose version
WORKDIR /app
ENV NODE_ENV=production \
PORT=8080 \
HOSTNAME=0.0.0.0 \
NEXT_TELEMETRY_DISABLED=1
COPY --from=build /app/.next/standalone ./
COPY --from=build /app/.next/static ./.next/static
COPY --from=build /app/public ./public
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s \
CMD curl -fsS http://127.0.0.1:8080/api/health || exit 1
# Runs as root: required for the docker socket and to keep edited server
# files owned by the MC user (the panel chowns writes to uid/gid 1000).
CMD ["node", "server.js"]