From 4d9a276a5c93e3a9bb62995384b2906ba2b8cff7 Mon Sep 17 00:00:00 2001 From: Arlind Date: Mon, 5 Jan 2026 17:06:44 +0100 Subject: [PATCH] Update Dockerfile --- Dockerfile | 73 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index 17bce40..0183c77 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,50 +1,66 @@ -FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu22.04 +FROM nvidia/cuda:12.8.0-runtime-ubuntu24.04 +# Core runtime + build deps + GL/GLVND RUN apt-get update && apt-get install -y \ + # graphics / GL + libglvnd0 \ + libgl1 \ + libegl1 \ + libgles2 \ + libx11-6 \ + libxext6 \ xvfb \ libgtk-3-0 \ - libgtk-3-dev \ - libgl1 \ - unzip \ - xz-utils \ - wget \ + # build tools + build-essential \ autoconf \ pkg-config \ - build-essential \ curl \ - libpng-dev \ - zip \ + wget \ git \ git-lfs \ jq \ - fonts-urw-base35 \ + libssl-dev \ + ca-certificates \ + # compression/tools + unzip \ + xz-utils \ + zip \ + # image / media deps + libpng-dev \ libfreetype6-dev \ libfontconfig1-dev \ - ghostscript \ - openssh-client \ - fonts-noto-color-emoji \ - fonts-dejavu-core \ libxml2 \ libxml2-dev \ + ghostscript \ webp \ + # fonts + fonts-urw-base35 \ + fonts-noto-color-emoji \ + fonts-dejavu-core \ + \ && fc-cache -f -v \ - && apt clean \ + && apt-get clean \ && rm -rf /var/lib/apt/lists/* +# Vulkan / GL debug tools (optional but handy) RUN apt-get update && apt-get install -y \ vulkan-tools \ mesa-utils \ && rm -rf /var/lib/apt/lists/* +# NVIDIA GLVND env (paths used by nvidia-container-runtime) ENV LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:${LD_LIBRARY_PATH} ENV __GLX_VENDOR_LIBRARY_NAME=nvidia +# Go toolchain RUN curl -fsSL https://go.dev/dl/go1.24.1.linux-amd64.tar.gz -o /tmp/go.tar.gz && \ rm -rf /usr/local/go && \ tar -C /usr/local -xzf /tmp/go.tar.gz && \ ln -s /usr/local/go/bin/go /usr/local/bin/go && \ rm /tmp/go.tar.gz +# danser build RUN git clone --branch fix-screenshot-slider-ticks --single-branch https://github.com/Arlind-dev/danser-go.git /app/danser && \ cd /app/danser && \ go build -o danser-cli . && \ @@ -55,6 +71,7 @@ RUN mkdir -p /app/danser/songs \ /app/danser/videos \ /app/danser/screenshots +# FFmpeg (prebuilt bundle) RUN wget -qO- $(curl -s https://api.github.com/repos/BtbN/FFmpeg-Builds/releases/latest \ | grep "browser_download_url.*linux64-gpl-shared.tar.xz" \ | cut -d '"' -f 4) -O /tmp/ffmpeg.tar.xz && \ @@ -68,32 +85,35 @@ RUN wget -qO- $(curl -s https://api.github.com/repos/BtbN/FFmpeg-Builds/releases cp /usr/local/bin/ffplay /app/danser/ffmpeg/ || true && \ ldconfig +# ImageMagick build RUN IMAGICK_URL=$(curl -s https://api.github.com/repos/ImageMagick/ImageMagick/releases/latest \ | jq -r '.tarball_url') && \ wget -qO- "$IMAGICK_URL" | tar xz && \ cd ImageMagick-* && \ ./configure --prefix=/usr/local \ - --with-bzlib=yes \ - --with-fontconfig=yes \ - --with-freetype=yes \ - --with-gslib=yes \ - --with-gvc=yes \ - --with-jpeg=yes \ - --with-jp2=yes \ - --with-png=yes \ - --with-tiff=yes \ - --with-xml=yes \ - --with-gs-font-dir=yes && \ + --with-bzlib=yes \ + --with-fontconfig=yes \ + --with-freetype=yes \ + --with-gslib=yes \ + --with-gvc=yes \ + --with-jpeg=yes \ + --with-jp2=yes \ + --with-png=yes \ + --with-tiff=yes \ + --with-xml=yes \ + --with-gs-font-dir=yes && \ make -j$(nproc) && \ make install && \ ldconfig /usr/local/lib/ && \ cd / && rm -rf ImageMagick-* +# NodeJS 20 RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ && apt-get install -y nodejs \ && npm install -g npm@latest \ && rm -rf /var/lib/apt/lists/* +# danser dirs + assets RUN mkdir -p /app/danser/custom-replays/ \ /app/danser/skins/default-skin/ @@ -102,6 +122,7 @@ COPY src/replays/* /app/danser/custom-replays/ COPY src/settings/* /app/danser/settings/ COPY src/default-skin/ /app/danser/skins/default-skin/ +# non-root user 1000:1000 RUN groupadd -g 1000 appuser && \ useradd -u 1000 -g 1000 -m -s /bin/bash appuser && \ chown -R 1000:1000 /app